Code adaption for ssl and basic auth support