我可以通过使用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
当前回答
我在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列表,它工作。
其他回答
注意:这具有重大的安全影响。
打开终端,执行以下命令:
export GIT_SSL_NO_VERIFY=1
它为我工作,我使用Linux系统。
我做了什么来解决这个问题在终端(Ubuntu 18.04):
openssl s_client -showcerts -servername www.github.com -connect www.github.com:443
我得到了两个证书块。我将证书块复制到我的证书文件/etc/ssl/certs/ca-certificates.crt。
基于VonC给出的非常好的答案,我刚刚创建了一个bash脚本,将缺失的x509证书安装到证书包中。它适用于基于debian的linux发行版。
#!/bin/bash
CERTIFICATE_PEM=certificate.pem
CERTIFICATE_CRT=certificate.crt
# get certificate
echo -n | openssl s_client -showcerts -connect gitlab.sehlat.io:443 \
2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
> $CERTIFICATE_PEM
# format certificate from PEM (human-readable) to CRT
openssl x509 -in $CERTIFICATE_PEM -out $CERTIFICATE_CRT
# move it to ca-certificates folder & update the bundle file
sudo mv ./$CERTIFICATE_CRT /usr/local/share/ca-certificates/
sudo update-ca-certificates
# configuring git
git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
我尝试了很多解决方法,但没有一个对我有效。我有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才会带来积极的结果。
我刚刚遇到了非常相同的问题,一个git存储库,这总是为我工作。问题是我通过公共WiFi访问它,它会在第一次连接时重定向到专用门户(例如显示广告并同意tos)。