在Linux机器上,我想在NTLM代理后面克隆GitHub存储库。
我知道Stackoverflow上的答案(如A,B或C)关于git
和代理人的答案,我按照他们的说法完成了以下操作:
在我的.gitconfig
我已经以
[http]
sslVerify = false
proxy = http://<user>:<password>@<ip-adress>:<port-number>
[https]
sslVerify = false
proxy = http://<user>:<password>@<ip-adress>:<port-number>
(注意:我已尝试过,但也没有禁用SSL。)
此外,我设置了环境变量
HTTP_PROXY=http://<user>:<password>@<ip-adress>:<port-number>
HTTPS_PROXY=http://<user>:<password>@<ip-adress>:<port-number>
用于基础curl
来电。
我仍然无法连接。例如,我发出
git clone http://github.com/doorOfChoice/json-view
如果我事先通过export GIT_CURL_VERBOSE=1
打开调试输出,我会收到以下错误信息输出:
Cloning into 'json-view'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy <ip-address> port <port-number> (#0)
* Trying <ip-address>... * Connected to <ip-address> (<ip-address>) port <port-number> (#0)
> GET http://github.com/doorOfChoice/json-view/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/2.6.0
Host: github.com
Accept: */*
Accept-Encoding: gzip
Proxy-Connection: Keep-Alive
Accept-Language: en-US, *;q=0.9
Pragma: no-cache
< HTTP/1.1 407 Proxy Access Denied
< Expires: 0
< Server: WebMarshal Proxy
< Cache-Control: no-cache
< Connection: keep-alive
< Proxy-Connection: keep-alive
< Via: 1.1 WEBMARSHAL
< Content-Length: 2339
< Content-Type: text/html; charset=utf-8
< Proxy-Authenticate: Negotiate
< Proxy-Authenticate: NTLM
< Proxy-Authenticate: Basic realm="WebMarshal Proxy Server"
< X-WebMarshal-RequestID: <request-id>
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host <ip-address> left intact
* Issue another request to this URL: 'http://github.com/doorOfChoice/json-view/info/refs?service=git-upload-pack'
* Couldn't find host github.com in the .netrc file; using defaults
* Re-using existing connection! (#0) with host <ip-address>
* Connected to <ip-address> (<ip-address>) port <port-number> (#0)
> GET http://github.com/doorOfChoice/json-view/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/2.6.0
Host: github.com
Accept: */*
Accept-Encoding: gzip
Proxy-Connection: Keep-Alive
Accept-Language: en-US, *;q=0.9
Pragma: no-cache
< HTTP/1.1 407 Proxy Access Denied
< Expires: 0
< Server: WebMarshal Proxy
< Cache-Control: no-cache
< Connection: keep-alive
< Proxy-Connection: keep-alive
< Via: 1.1 WEBMARSHAL
< Content-Length: 2339
< Content-Type: text/html; charset=utf-8
* gss_init_sec_context() failed: : Credentials cache file '<tmp-file>' not found< Proxy-Authenticate: Negotiate
< Proxy-Authenticate: NTLM
< Proxy-Authenticate: Basic realm="WebMarshal Proxy Server"
< X-WebMarshal-RequestID: <request-i>dstack
<
* Connection #0 to host <ip-address> left intact
fatal: unable to access 'http://github.com/doorOfChoice/json-view/': The requested URL returned error: 407
奇怪的是, curl
对它自己有效!那么通过git和curl获取之间有什么不同?如何让git clone <URL>
在这种代理背后工作?