我被困在防火墙后面,所以必须使用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,否则我就完了。


当前回答

对于那些使用Msys/MinGW GIT的用户,添加这个

  export GIT_SSL_CAINFO=/mingw32/ssl/certs/ca-bundle.crt 

其他回答

我使用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

您可以在终端中尝试此命令:

Git配置——global http。sslVerify假

我也有同样的问题。 证书导入或取消ssl验证的命令不起作用。 原来是过期的网络代理密码。 代理配置条目。在我的Windows用户配置文件中的.gitconfig文件中。 我只是删除了整个条目,它又开始工作了。

你看时间了吗?

我绝对拒绝让我的git操作变得不安全,在尝试了人们在这里提到的所有东西之后,我突然发现,证书无法通过验证的一个可能原因是日期错误(要么是证书过期日期,要么是本地时钟)。

您可以通过在终端中输入日期轻松地进行检查。在我的情况下(一台新的树莓派),本地时钟被设置为1970年,所以一个简单的ntpdate -u 0.ubuntu.pool.ntp.org修复了所有问题。对于rPi,我也建议你将以下脚本放在日常cron作业中(例如/etc/cron.daily/ntpdate):

#!/bin/sh
/usr/sbin/ntpdate -u 0.ubuntu.pool.ntp.org 1> /dev/null 2>&1

如果你只想在github.com上使用Cygwin git客户端,有一种更简单的方法,而不必经历下载、提取、转换和分割证书文件的麻烦。按以下步骤进行(我假设Windows XP与Cygwin和Firefox)

In Firefox, go to the github page (any) click on the github icon on the address bar to display the certificate Click through "more information" -> "display certificate" --> "details" and select each node in the hierarchy beginning with the uppermost one; for each of them click on "Export" and select the PEM format: GTECyberTrustGlobalRoot.pem DigiCertHighAssuranceEVRootCA.pem DigiCertHighAssuranceEVCA-1.pem github.com.pem Save the above files somewhere in your local drive, change the extension to .pem and move them to /usr/ssl/certs in your Cygwin installation (Windows: c:\cygwin\ssl\certs ) (optional) Run c_reshash from the bash.

就是这样。

当然,这只安装一个证书层次结构,你需要的github。当然,您可以将此方法用于任何其他站点,而不需要安装200个您(不一定)信任的站点。