git/list[1] front-page[2] threads[3] people[4] search[5] about
 

https_proxy and libcurl

From
Phil Hord <phil.hord@gmail.com>
Date
Feb 22, 2013, 21:19 UTC
Message-ID
<CABURp0qQ6tO0B4Ya6OStX59SJqG-Jx1F4g6MUL7tVwR_6VgDhw@mail.gmail.com>

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.com

The 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:443
So it is with wget.  But with curl, it is equivalent to this:
    http_proxy=proxy.myco.com:1080
    https_proxy=proxy.myco.com:1080
Git 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 failed

If 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 failed
This 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:443
Phil

[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.

Next: Junio C Hamano
Message 1 of 4 in “https_proxy and libcurl”
  1. Phil HordFeb 22, 2013
  2. Junio C HamanoFeb 22, 2013
  3. Daniel StenbergFeb 22, 2013
  4. Phil HordFeb 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.