I have been unable to clone via http proxy because of a wrongly configured proxy setup in my lab.
I had this env:
http_proxy=http://proxy.myco.com
https_proxy=https://proxy.myco.comThe problem is that libcurl ignores the protocol part of the proxy url, and it defaults to port 1080. wget honors the protocol specifier, but it defaults to port 80 if none is given.
So, I thought my env was equivalent to this:
http_proxy=proxy.myco.com:80
https_proxy=proxy.myco.com:443So it is with wget. But with curl, it is equivalent to this:
http_proxy=proxy.myco.com:1080
https_proxy=proxy.myco.com:1080Git clone gave a confusing (but correct) error message:
$ export https_proxy=https://proxy.myco.com
$ git clone https://github.com/git/git
Cloning into 'git'...
error: The requested URL returned error: 500 while accessing
https://github.com/git/git/info/refs?service=git-upload-pack
fatal: HTTP request failedIf I didn't have https_proxy set at all, I got a long timeout as it tried to connect directly and ran into our firewall.
$ unset https_proxy
$ git clone https://github.com/git/git
Cloning into 'git'...
error: Failed connect to github.com:443; Connection timed out
while accessing
https://github.com/git/git/info/refs?service=git-upload-pack
fatal: HTTP request failedThis also did not help, of course:
'git config http.proxy https://proxy.myco.com'But this did:
'git config http.proxy https://proxy.myco.com:443'The fix was to specify the port explicitly, like this:
http_proxy=proxy.myco.com:80
https_proxy=proxy.myco.com:443Phil
[1] An added wrinkle is that there is a proxy server listening on 1080, but it does not support encrypted connections. A listener on 443 does handle https requests correctly.