我被困在防火墙后面,所以必须使用HTTPS访问我的GitHub存储库。我在Windows XP上使用cygwin 1.7.7。

我试过把遥控器设置为https://username@github.com/username/ExcelANT.git,但按下输入密码的提示,但输入后没有任何反应。 https://username:<密码>github.com/username/ExcelANT.git和克隆空回购从零开始,但每次它给我同样的错误

错误:SSL证书有问题,请检查CA证书是否正确。细节: SSL例程:SSL3_GET_SERVER_CERTIFICATE:访问https://github.com/username/ExcelANT.git/info/refs时证书验证失败

打开GIT_CURL_VERBOSE=1会给我

* About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * successfully set certificate verify locations: * CAfile: none CApath: /usr/ssl/certs * SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed * Expire cleared * Closing connection #0 * About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * successfully set certificate verify locations: * CAfile: none CApath: /usr/ssl/certs * SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed * Expire cleared * Closing connection #0 error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/username/ExcelANT.git/info/refs

fatal: HTTP request failed

这是我的防火墙有问题吗,cygwin还是什么?

我没有在Git配置中设置HTTP代理,但是它是一个ISA服务器,需要NTLM身份验证,不是基本的,所以除非有人知道如何强制Git使用NTLM,否则我就完了。


当前回答

注意:关闭SSL验证功能存在安全影响。当您使用Git通过网络传输数据时,它允许中间人攻击。在使用此解决方案之前,请确保您完全理解安全影响。或者更好的方法是安装根证书。

一种方法是禁用SSL CERT验证:

git config --global http.sslVerify false

这将阻止CURL验证HTTPS认证。

仅针对一个存储库:

git config http.sslVerify false

其他回答

设置SSL验证为false时在windows上克隆:

    git -c http.sslVerify=false clone http://example.com/e.git

如果你想克隆而不无聊你的全局设置。

我在必须管理的协作开发平台上配置Git时遇到了同样的问题。

解决方法:

I've Updated the release of Curl installed on the server. Download the last version on the website Download page of curland follow the installation proceedings Installation proceedings of curl Get back the certificate of the authority which delivers the certificate for the server. Add this certificate to the CAcert file used by curl. On my server it is located in /etc/pki/tls/certs/ca-bundle.crt. Configure git to use this certificate file by editing the .gitconfig file and set the sslcainfo path. sslcainfo= /etc/pki/tls/certs/ca-bundle.crt On the client machine you must get the certificate and configure the .gitconfig file too.

我希望这对你们中的一些人有所帮助。

我在Solaris Express 11上也遇到过同样的问题。我花了一些时间,但我设法找到了需要放置证书的地方。根据“/etc/openssl/openssl.cnf”,证书路径为“/etc/openssl/certs”我放置了使用Alexey的上述建议生成的证书。

你可以在命令行上使用openssl验证事情是否正常工作:

openssl s_client -connect github.com:443

如果你使用的是基于debian的操作系统,你可以简单地运行

安装ca-certificates

我使用apt-cyg(一个类似于apt-get的伟大安装程序)来解决这个问题 轻松下载ca-certificates(包括Git等):

apt-cyg install ca-certificates

注意:apt-cyg需要先安装。你可以在Windows上这样做 命令行:

cd c:\cygwin
setup.exe -q -P wget,tar,qawk,bzip2,subversion,vim

关闭Windows cmd,打开Cygwin Bash:

wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin