我可以通过使用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
当前回答
我做了什么来解决这个问题在终端(Ubuntu 18.04):
openssl s_client -showcerts -servername www.github.com -connect www.github.com:443
我得到了两个证书块。我将证书块复制到我的证书文件/etc/ssl/certs/ca-certificates.crt。
其他回答
我知道已经有很多答案了。对于那些使用专用网络(如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
让我们加密2021年9月30日根CA到期
这个错误的另一个来源是一个过期的根CA,如果你使用Let's Encrypt,它昨天发生在其中一个根CA上: https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt/
您可以通过运行来确认
openssl s_client -showcerts -connect $hostname:$port -servername $hostname | grep "certificate has expired"
在这种情况下,您需要在/etc/gitlab/ssl/$hostname.crt中编辑gitlab证书
将文件中过期的DST根CA X3块替换为https://letsencrypt.org/certs/isrgrootx1.pem的内容,并重新加载服务器。
检查你的系统时钟,
美元的日期
如果不正确,证书检查将失败。要纠正系统时钟,
安装NTP
时钟应该自动同步。
最后再次输入clone命令。
注意:这具有重大的安全影响。
如果您在专用网络中使用git服务器,并使用自签名证书或IP地址证书;你也可以简单地使用git全局配置来禁用SSL检查:
git config --global http.sslverify "false"
在做其他事情之前,检查是否有一个正在运行的代理,比如可以暂时关闭的Zscaler。然后检查你的日期,如上所述。