added ssl and basic authentication support