git克隆是否通过NTLM代理工作? [英] Does git clone work through NTLM proxies?

查看:282
本文介绍了git克隆是否通过NTLM代理工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过使用 export http_proxy = http:// [username]:[pwd] @ [proxy] git config - -global http.proxy http:// [username]:[pwd] @ [proxy]



我无法使其工作。它看起来像git使用基本身份验证:

 初始化的空Git存储库在/home/.../.git/ 
*在.netrc文件中找不到主机github.com,使用默认值
*关于连接()到github.com端口8080(#0)
*尝试10 .... *连接到github.com(10 ....)端口8080(#0)
*使用基本代理auth使用用户'...'
> GET http://github.com/sunlightlabs/fiftystates.git/info/refs HTTP / 1.1
代理授权:基本MD ...
用户代理:git / 1.6.1.2
Host:github.com
Pragma:no-cache
接受:* / *
代理连接:Keep-Alive

< HTTP / 1.1 407代理认证需要(ISA服务器需要授权来完成请求。访问t
Web代理过滤器被拒绝。)
< Via:1.1 ...
<代理认证:Negotiate
<代理认证:Kerberos
<代理认证:NTLM
<连接:Keep-Alive
<代理连接:Keep-Alive
< Pragma:no-cache
< Cache-Control:no-cache
< Content-Type:text / html
< Content-Length:4118
*请求的网址返回错误:407
*关闭连接#0
致命:http://github.com/sunlightlabs/fiftystates.git/info/refs下载错误 - 请求的网址返回错误:407

Google搜索返回了混合结果,在某处它说, curl 是在引擎盖下使用,但它的选项被硬连线到代码。例如,

  curl --proxy-ntlm --proxy ...:8080 google.com 



有效,我想使用与git相同的选项。



我需要一些更明确的答案在这里:有人成功使用git通过Windows代理?哪个版本?



感谢。

解决方案

Git支持NTLM代理验证, strong> 1.7.10 以后,相关提交是 https://github.com/gitster/git/commit/ dd6139971a18e25a5089c0f96dc80e454683ef0b



1.7.10 发布说明简要提及它:

  * HTTP传输如果需要,学习如何与代理进行身份验证。 

我已经成功地在我的工作场所使用代理测试它是NTLM并要求用户/您可以使用以下命令测试自己:

  git config --global http.proxy http:// user:password @ proxy。 com:port 
git clone http://git.videolan.org/git/bitstream.git

此致,


I've tried both using export http_proxy=http://[username]:[pwd]@[proxy] and git config --global http.proxy http://[username]:[pwd]@[proxy].

I couldn't make it work. It looks like git uses Basic authentication:

Initialized empty Git repository in /home/.../.git/
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 8080 (#0)
*   Trying 10.... * Connected to github.com (10....) port 8080 (#0)
* Proxy auth using Basic with user '...'
> GET http://github.com/sunlightlabs/fiftystates.git/info/refs HTTP/1.1
Proxy-Authorization: Basic MD...
User-Agent: git/1.6.1.2
Host: github.com
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive

< HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to t
he Web Proxy filter is denied.  )
< Via: 1.1 ...
< Proxy-Authenticate: Negotiate
< Proxy-Authenticate: Kerberos
< Proxy-Authenticate: NTLM
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
< Pragma: no-cache
< Cache-Control: no-cache
< Content-Type: text/html
< Content-Length: 4118
* The requested URL returned error: 407
* Closing connection #0
fatal: http://github.com/sunlightlabs/fiftystates.git/info/refs download error - The requested URL returned error: 407

Google search returned mixed and probably not updated results. Somewhere it says that curl is (was?) used under the hood, but its options are (were?) hardwired into code. For example,

curl --proxy-ntlm --proxy ...:8080 google.com

works, and I'd like to use the same option with git.

I need some more definite answers here: has anybody succeed using git through Windows proxies? Which version?

Thanks.

解决方案

Git supports NTLM proxy authentication from version 1.7.10 onwards, relevant commit is https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b

1.7.10 release notes briefly mentioned it as:

* HTTP transport learned to authenticate with a proxy if needed.

I've successfully tested it with the proxy at my workplace which is NTLM and requires user/pass, you can test yourself with following commands:

git config --global http.proxy http://user:password@proxy.com:port
git clone http://git.videolan.org/git/bitstream.git

Regards,

这篇关于git克隆是否通过NTLM代理工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆