2015-11-30 57 views
0

我的git客户端在公司代理之后。该代理使得ssl截取。git推送代理与ssl拦截

我设法抑制SSL证书问题与git config --global http.sslcainfo PATH-TO-PROXY-CA-CERT

现在我可以克隆从GitHub /到位桶/ gitlab/...库通过HTTPS(SSH受阻)

但每当我要认证(例如,用于私人回购或推的东西)我得到的消息fatal: Authentication failed for ...有时也

remote: Anonymous access to ... denied. 
fatal: Authentication failed for '...' 

为什么我得到这些错误,我能做些什么,使工作?

+0

是否需要验证的代理? – MrTux

+0

是的。我使用cntlm进行身份验证。终端本身被配置为代理。 git没有设置http.proxy。 (设置它不能解决问题) –

回答

0

解决方案:在这种情况下,公司代理删除出于安全原因的证书。

+0

这不是一个真正的解决方案,是吗? – Malnormalulo

1

另请注意,如果您的密码有@或任何特殊字符,则设置代理时会出现身份验证问题。您需要在设置代理的同时转义。

如果您位于公司防火墙的后面,并且您的所有请求都通过代理服务器,那么您必须首先设置Git代理,然后再运行任何get命令,如pull,fetch和push命令。

要设置HTTP的Git的代理和HTTPS使用下面的Git在GIT的bash命令外壳

git config --global http.proxy http://username:[email protected]:8080 
git config --global https.proxy http://username:[email protected]:8080 

//Replace username with your proxy username 
//Replace password with your proxy password 
//Replace proxy.server.com with the proxy domain URL. 
//Replace 8080 with the proxy port no configured on the proxy server. 

检查How to configure Git proxyHow to unset the Git Proxy更多细节