我可以通过使用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
当前回答
我知道已经有很多答案了。对于那些使用专用网络(如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
其他回答
最后,添加http。Sslverify到你的.git/config。
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://server/user/project.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[http]
sslVerify = false
我尝试了很多解决方法,但没有一个对我有效。我有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才会带来积极的结果。
导致这个问题的另一个原因可能是你的生物钟可能走错了。证书是时间敏感的。
查询当前系统时间。
date -R
您可以考虑安装NTP以从全局NTP池自动将系统时间与可信的internet时间服务器同步。例如,在Debian/Ubuntu上安装:
apt-get install ntp
也有同样的问题。由自己颁发的证书颁发机构引起。 通过在/usr/local/share/ca-certificates/中添加.pem文件解决 和调用
sudo update-ca-certificates
PS:“/share/ca-certificates”文件夹下的pem文件必须有扩展名。crt
GIT_CURL_VERBOSE=1 git [clone|fetch]…
应该能告诉你问题在哪里。在我的例子中,这是因为cURL在基于NSS构建时不支持PEM证书,因为这种支持在NSS中不是主线(#726116 #804215 #402712等等)。