Grab useful changes from upstream repository into our fork.
Fixed bug with not connecting to server behind proxy if the server is not secure.