1

这是一个常见的问题/问题,但是我遇到的问题与其他问题略有不同。我正在尝试通过我的 http 代理在工作中使用 git。我已经在 git 中配置了代理设置:

C:\Program Files (x86)\Git\bin>git config --global -l
http.proxy=https://c172635b4:password@p01.proxy.local:8080

当我发出 git ls-remote https://eric@git.assembla.com/myproj.git时,它会要求我输入密码并提供预期的结果。这证实了 git 正在通过代理正确地进行身份验证。

但是,当我尝试执行 git clone 时,出现以下错误。

error: RPC failed; result=22, HTTP code = 0
fatal: The remote end hung up unexpectedly

我已经使用 GIT_CURL_VERBOSE=1 运行它来查看日志,并且我能够看到它正确地对 NTLM 代理进行身份验证,直到结束:

< HTTP/1.1 407 Proxy Authentication Required
< Proxy-Authenticate: NTLM TlRMTVNTUAACAAAABgAGADgAAAA1goniA432smdf3mwAAAAAAAAAALAAsAA+AAAABgByFwAAAA9SAEUAUwACAAYAUgBFAFMAAQAYAFcAUwBQAEkAQwBCAEMAQQBBAEEAMAAxAAQAHAByAGUAcwAuAGIAbgBnAGYALgBsAG8AYwBhAGwAAwA2AFcAUwBQAEkAQwBCAEMAQQBBAEEAMAAxAC4AcgBlAHMALgBiAG4AZwBmAC4AbABvAGMAYQBsAAUAHAByAGUAcwAuAGIAbgBnAGYALgBsAG8AYwBhAGwABwAIAGq6JY+ND84BAAAAAA==
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: Keep-Alive
< Set-Cookie: BCSI-CS-dcfa3879f83cfd49=2; Path=/
< Connection: Keep-Alive
< Content-Length: 3742
< 
* Ignore 3742 bytes of response-body
* NTLM send, close instead of sending 2531 bytes
* Received HTTP code 407 from proxy after CONNECT
* About to connect() to proxy p01.proxy.local port 8080 (#0)
*   Trying 172.31.132.18... * connected
* Connected to p01.proxy.local (172.31.132.18) port 8080 (#0)
* Establish HTTP proxy tunnel to git.assembla.com:443
* Proxy auth using NTLM with user 'c172635b4'
* Server auth using Basic with user 'eric'
> CONNECT git.assembla.com:443 HTTP/1.1
Host: git.assembla.com:443
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAIIAAAAYABgAmgAAAAYABgBYAAAAEAAQAF4AAAAUABQAbgAAABAAEACyAAAANYKI4gYBsR0AAAAPN9Y0OSiIbF7a4dr8yIqv9WwAYgBnAGMANgAxADIANwAxAGIANAAyAFUAQQAxADMAOAAxAEQAUwA1ADKgzMJlkKLlAAAAAAAAAAAAAAAAAAAAAHVtirzD6urrzJLWZ73HGWxFUEd926He985LMc+KepdWBDDgQQBESv8=
User-Agent: git/1.7.10.5997.gaa4aa
Proxy-Connection: Keep-Alive
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip

< HTTP/1.1 407 Proxy Authentication Required
< Proxy-Authenticate: NTLM
* Authentication problem. Ignoring this.
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Set-Cookie: BCSI-CS-dcfa3879f83cfd49=2; Path=/
< Connection: close
< Content-Length: 3742
< 
* Closing connection #0
* HTTP response code said error

我在跑步:

git version 1.7.10.msysgit.1

curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL SSPI libz

我确实在SO上找到了另一个帖子,这与该问题的重复尽可能接近,但那里没有公认的解决方案,也没有任何适用的建议。

有人对如何进一步调试问题和/或使其正常工作有任何建议吗?

4

1 回答 1

1

在尝试了多个版本的 Curl 和/或 git 之后,我终于安装了一个本地代理服务器并通过那里隧道 git。我最终使用了cntlm,但有一些不同的方法可以工作。

我仍然不知道为什么 curl 我的代理服务器有问题,但是使用 cntlm 作为中间人可以正常工作。

于 2013-02-25T20:35:19.530 回答