在 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>
在这种类型的代理后面工作?