我可以通过使用ssh的克隆项目推送,但它不工作时,我克隆项目与https。
它显示的错误信息是:
server certificate verification failed. CAfile: /etc/ssl/certs/cacertificates.crt CRLfile: none
我可以通过使用ssh的克隆项目推送,但它不工作时,我克隆项目与https。
它显示的错误信息是:
server certificate verification failed. CAfile: /etc/ssl/certs/cacertificates.crt CRLfile: none
当前回答
我搞砸了我的CA文件,而我设置goagent代理。不能从github拉数据,并得到相同的警告:
服务器证书验证失败。CAfile: /etc/ssl/certs/ca-certificates。crt CRLfile:无
使用Vonc的方法,从github获取证书,并将其放入/etc/ssl/certs/ca-certificates。Crt,问题解决了。
echo -n | openssl s_client -showcerts -connect github.com:443 2>/dev/null | sed -ne '/- begin CERTIFICATE-/,/- end CERTIFICATE-/p'
其他回答
我在树莓派2上安装了Xubuntu,发现时间上也有同样的问题,NTP和自动服务器同步是关闭的(或者没有安装)。得到国家结核控制规划
sudo apt-get install ntp
将“时间及日期”由“手动”改为“与互联网服务器保持同步”
GIT_CURL_VERBOSE=1 git [clone|fetch]…
应该能告诉你问题在哪里。在我的例子中,这是因为cURL在基于NSS构建时不支持PEM证书,因为这种支持在NSS中不是主线(#726116 #804215 #402712等等)。
我尝试了很多解决方法,但没有一个对我有效。我有4个运行在ubuntu 16.04上的服务器,我实际上能够解决这个问题的方法有3个(你应该首先sudo apt update):
更新openssl,因为我安装的版本缺少一个修复程序,可以让一些解决方案在这里工作。Sudo apt install——only-upgrade openssl。Openssl至少需要1.0.2g-1ubuntu4.20版本。 然后我必须对certs做同样的事情:sudo apt install——only-upgrade ca-certificates 然后重新配置certs sudo dpkg-reconfigure ca-certificates(我猜是编辑配置文件)并从列表中删除DST_Root_CA_X3才会带来积极的结果。
我在GitLab服务器上遇到了这个问题。通过cmd更新Linux的可信CA列表后解决了这个问题:
sudo apt-get install --reinstall ca-certificates
以下是步骤:
git跟踪返回如下错误:
GIT_CURL_VERBOSE=1 GIT_TRACE=2 git clone https://mygitlab
...
...
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
* server certificate verification failed. CAfile: none CRLfile: none
* Closing connection 0
**fatal: unable to access 'https://mygitlab/some.git/': server certificate verification failed. CAfile: none CRLfile: none**
查看git服务器的CA Issuer:
echo -n | openssl s_client -showcerts -connect yourserver.com:YourHttpGilabPort \
2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
| openssl x509 -noout -text | grep"CA Issuers" | head -1
...
...
CA Issuers - URI:http://r3.i.lencr.org/
为什么r3.i.lencr.org不可信?我尝试更新CA列表,它工作。
或者简单地运行这个注释来添加服务器证书到你的数据库:
echo $(echo -n | openssl s_client -showcerts -connect yourserver.com:YourHttpGilabPort 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') >> /etc/ssl/certs/ca-certificates.crt
然后再做git克隆。