2017-08-29 4:13 GMT+08:00 Jeff King <[email protected]>:

> On Mon, Aug 28, 2017 at 12:50:39PM -0700, Jonathan Nieder wrote:
>
>> (cc-ing the git mailing list and some proxy specialists there)
>
> I'm definitely not a specialist in our proxy code, but as far as I know
> most of that is handled magically behind the scenes by curl.
>
> The big thing Git may have to do is recognize the 407 response, feed
> curl the proxy credentials, and retry the request. But in this case,
> the user provided them in the proxy url:
>
>> $ HTTPS_PROXY=http://username:password@proxy:80 git clone
>> https://github.com/linuxdeepin/deepin-deb-installer.git
>
> So in this sequence, we see the initial connection:
>
>> > CONNECT github.com:443 HTTP/1.1
>> > Host: github.com:443
>> > User-Agent: git/2.14.1
>> > Proxy-Connection: Keep-Alive
>> >
>> > HTTP/1.0 407 Proxy Authentication Required
>> > Server: squid/2.7.STABLE9
>> > Date: Sun, 27 Aug 2017 14:27:38 GMT
>> > Content-Type: text/html
>> > Content-Length: 1226
>> > X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
>> > Proxy-Authenticate: Basic realm="Proxy"
>> > X-Cache: MISS from inproxy2
>> > X-Cache-Lookup: NONE from inproxy2:8000
>> > Via: 1.0 inproxy2:8000 (squid/2.7.STABLE9)
>> > Connection: close
>
> The proxy asks us to authenticate, and then (modulo a little bit of
> line-break cleanup):
>
>> > CONNECT github.com:443 HTTP/1.1
>> > Host: github.com:443
>> > Proxy-Authorization: Basic MYPASSWORD
>> > User-Agent: git/2.14.1
>> > Proxy-Connection: Keep-Alive
>
> We retry. But AFAIK this is all internal to curl, and Git won't have
> seen any of it.
>
> There's no more of the trace, but I'd guess at this point that curl is
> waiting for the proxy to say something in response to the CONNECT (but
> I'm a little rusty on the protocol sequence for http proxies).
>
>> Can you say more about this?  How is your proxy configured (e.g. can
>> you provide output from "git config -l")?  Did a previous version of

user.name=yangfl
[email protected]
push.default=simple

>> Git work better?  Any more details about the proxy setup that might

Yes, I use this porxy for more than one year with git IIRC without any problem.

$ cat /var/log/apt/history.log | grep git
Start-Date: 2017-08-26  06:02:12
Upgrade: git:amd64 (1:2.14.1-1, 1:2.14.1-2)

>> help track this down?

This proxy is out of my control, sorry :(

>
> I'd also wonder if doing:
>
>   repo=https://github.com/linuxdeepin/deepin-deb-installer.git
>   curl ${repo}/info/refs?service=git-upload-pack
>
> works, or if it sometimes misbehaves similarly.
>

Yes, curl works happily.

$ curl --version
curl 7.55.0 (x86_64-pc-linux-gnu) libcurl/7.55.0 OpenSSL/1.0.2l
zlib/1.2.8 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) libssh2/1.8.0
nghttp2/1.24.0 librtmp/2.3
Release-Date: 2017-08-09

> -Peff

Reply via email to