由于公司代理证书更改,导致Git push失败

3

最近,公司代理的证书被更改了。从那时起,我在使用git时遇到了问题。当我尝试执行git push命令时,会收到以下错误:

error: gnutls_handshake() failed: The Diffie-Hellman prime sent by the server is not acceptable (not long enough). while accessing https://github.com/me/myproj.git/info/refs
fatal: HTTP request failed

我可以通过使用HTTP推送或通过执行git config --global http.sslVerify false关闭sslVerify来切换,但他们坚持要我仅使用HTTPS。

他们要求我在Ubuntu桌面系统范围内安装一个.cer证书文件(Ubuntu 12.04),但是我一直没有找到方法。请帮忙!

这是我执行export GIT_CURL_VERBOSE=1后获得的curl日志:

* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy proxy.mycompany.com port 5150 (#0)
*   Trying 10.226.xx.yyy... * Connected to proxy.mycompany.com (10.226.xx.yyy) port 5150 (#0)
* Establish HTTP proxy tunnel to github.com:443
* Proxy auth using Basic with user 'me'
> CONNECT github.com:443 HTTP/1.1
Host: github.com:443
Proxy-Authorization: Basic MjQABCD3Og==
User-Agent: git/1.7.9.5
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 200 Connection established
< Date: Tue, 23 Oct 2012 11:45:37 GMT
< Age: 0
< Proxy-Connection: Keep-Alive
< Via: 1.0 MYCOMPANYSERVER.MYCOMPANY.COM
< 
* Proxy replied OK to CONNECT request
* found 1 certificates in /etc/ssl/certs/cert.crt
* gnutls_handshake() failed: The Diffie-Hellman prime sent by the server is not acceptable (not long enough).
* Closing connection #0
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy proxy.mycompany.com port 5150 (#0)
*   Trying 10.226.xx.yyy... * Connected to proxy.mycompany.com (10.226.xx.yyy) port 5150 (#0)
* Establish HTTP proxy tunnel to github.com:443
* Proxy auth using Basic with user 'me'
> CONNECT github.com:443 HTTP/1.1
Host: github.com:443
Proxy-Authorization: Basic MjQABCD3Og==
User-Agent: git/1.7.9.5
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 200 Connection established
< Date: Tue, 23 Oct 2012 11:45:37 GMT
< Age: 0
< Proxy-Connection: Keep-Alive
< Via: 1.0 MYCOMPANYSERVER.MYCOMPANY.COM
< 
* Proxy replied OK to CONNECT request
* found 1 certificates in /etc/ssl/certs/cert.crt
* gnutls_handshake() failed: The Diffie-Hellman prime sent by the server is not acceptable (not long enough).
* Closing connection #0
error: gnutls_handshake() failed: The Diffie-Hellman prime sent by the server is not acceptable (not long enough). while accessing https://github.com/me/myproject.git/info/refs
fatal: HTTP request failed
1个回答

1

您的连接正在使用 /etc/ssl/certs/cert.crt 作为证书。

您可以尝试将您拥有的证书文件复制到 /etc/ssl/certs/ 下,然后以 root 用户身份在该目录中执行命令 c_rehash .(注意点号!)。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接