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


当前回答

我有一份粗糙的PI

pi@raspbmc:~$ git克隆http: //github.com/andreafabrizi/Dropbox-Uploader .git 克隆到'Dropbox-Uploader'… 错误:SSL CA证书(路径?),同时访问http:// github.com/andreafabrizi/Dropbox-Uploader.git/info/refs fatal: HTTP请求失败

所以id a

sudo apt-get install ca-certificates

then

git clone http://github.com/andreafabrizi/Dropbox-Uploader.git  

工作

其他回答

你看时间了吗?

我绝对拒绝让我的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

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

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

我希望Git使用更新后的证书包,而不替换整个系统使用的证书包。下面是如何让Git使用我的主目录中的一个特定文件:

mkdir ~/certs
curl https://curl.haxx.se/ca/cacert.pem -o ~/certs/cacert.pem

现在更新.gitconfig以使用它进行对等验证:

[http]
sslCAinfo = /home/radium/certs/cacert.pem

注意,我使用的是绝对路径。Git在这里不进行路径展开,所以在使用~的时候,会出现一个丑陋的程序集。或者,您可以跳过配置文件,而是通过环境变量git_ssl_caifo设置路径。

要解决此问题,请设置GIT_CURL_VERBOSE=1。Git使用的CA文件的路径将显示在输出中以“CAfile:”开头的行中。

编辑从http更改为https。

问题是您的系统上没有安装任何证书颁发机构证书。这些证书不能用cygwin的setup.exe安装。

更新:在cygwin安装Net/ca-certificates包(感谢dirkjot)

有两种解决方案:

实际安装根证书。Curl从Mozilla中为您提取证书。

cacert。Pem文件就是你要找的。该文件包含> 250个CA证书(不知道如何信任这个数量的ppl)。你需要下载这个文件,把它分解成单独的证书,把它们放到/usr/ssl/certs(你的CApath)并索引它们。

以下是如何做到这一点。使用cygwin setup.exe安装curl和openssl包 执行:

<!-- language: lang-bash -->

    $ cd /usr/ssl/certs
    $ curl http://curl.haxx.se/ca/cacert.pem |
      awk '{print > "cert" (1+n) ".pem"} /-----END CERTIFICATE-----/ {n++}'
    $ c_rehash

重要提示:为了使用c_rehash,你也必须安装openssl-perl。

Ignore SSL certificate verification. WARNING: Disabling SSL certificate verification has security implications. Without verification of the authenticity of SSL/HTTPS connections, a malicious attacker can impersonate a trusted endpoint (such as GitHub or some other remote Git host), and you'll be vulnerable to a Man-in-the-Middle Attack. Be sure you fully understand the security issues and your threat model before using this as a solution. $ env GIT_SSL_NO_VERIFY=true git clone https://github...

尝试使用命令

git config --global http.sslverify false

该命令将允许来自http的所有不安全的证书,如果在专业环境中使用,请谨慎使用。