2015-11-30 50 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更多細節