implement BaseUrl to allow https for Clients

Please review and merge.