我可以通过使用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
当前回答
我知道这是旧的,但有时错误再次弹出。如果您确信可以信任本地安装,那么只需在变量部分中添加:GIT_SSL_NO_VERIFY: "true"。通过这种方式,您只需禁用证书验证。
此解决方案与本文提出的解决方案类似,但它仅适用于当前git树,而不适用于全局git配置。
其他回答
首先要检查的是/etc/ssl和/etc/ssl/certs的文件权限
在使用证书颁发机构管理工具时,我错误地删除了文件权限(或删除了SSL rm -rf /etc/ SSL /*目录)。
就在那时,我注意到wget和curl CLI浏览器工具出现了完全相同的错误消息:
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
当我将/etc/ssl和/etc/ssl/cert目录的文件权限提高到o+rx-w时,这些CLI浏览器工具开始轻松一些:
mkdir -p /etc/ssl/certs
chmod u+rwx,go+rx /etc/ssl /etc/ssl/certs
我还必须重新创建Java子目录并重建受信任的CA证书目录:
mkdir /etc/ssl/certs/java
chmod u+rwx,go+rx /etc/ssl/certs/java
update-ca-certificates
海岸很安全。
我尝试了很多解决方法,但没有一个对我有效。我有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才会带来积极的结果。
我知道已经有很多答案了。对于那些使用专用网络(如Zscaler等)的用户来说,如果需要更新rootcert,则可能会出现此错误。如果在Windows机器上使用WSL,这里有一个关于如何实现此更新的解决方案:
#!/usr/bin/bash
# I exported the Zscaler certifcate out of Microsoft Cert Manager. It was located under 'Trusted Root Certification > Certificates' as zscaler_cert.cer.
# Though the extension is '.cer' it really is a DER formatted file.
# I then copied that file into Ubuntu running in WSL.
# Convert DER encoded file to CRT.
openssl x509 -inform DER -in zscaler_cert.cer -out zscaler_cert.crt
# Move the CRT file to /usr/local/share/ca-certificates
sudo mv zscaler_cert.crt /usr/local/share/ca-certificates
# Inform Ubuntu of new cert.
sudo update-ca-certificates
我在老旧的Ubuntu 16.04和GitLab上也遇到了同样的问题(其他电脑运行得很好)。
这个问题实际上是Git内部使用的旧版本的gnutls库。这个旧的库对服务器端的证书顺序很敏感——这个问题中有更多信息。最终的解决方案很简单:
apt-get update
apt-get upgrade libgnutls*
我遇到了詹金斯的问题。当我更新证书时,我开始面临这个错误。
stderr fatal: unable to access server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt
所以我已经在下面的文件中添加了我的新证书:
/etc/ssl/certs/ca-certificates.crt
该文件的内容如下所示:
-----BEGIN CERTIFICATE-----
blahblha
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
blahblha
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
blahblha
-----END CERTIFICATE-----
只要在底部附上你的证书:
-----BEGIN CERTIFICATE-----
blahblha
-----END CERTIFICATE-----