我可以通过使用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
当前回答
我遇到了詹金斯的问题。当我更新证书时,我开始面临这个错误。
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-----
其他回答
我在树莓派2上安装了Xubuntu,发现时间上也有同样的问题,NTP和自动服务器同步是关闭的(或者没有安装)。得到国家结核控制规划
sudo apt-get install ntp
将“时间及日期”由“手动”改为“与互联网服务器保持同步”
对于Windows上的MINGW64 Git Bash用户
以管理员身份启动Git Bash 在MINGW64终端中运行: echo -n | openssl s_client -showcerts -connect yourserver.com: yourhttpgitlabport 2>/dev/null | sed -ne '/- begin CERTIFICATE-/,/- end CERTIFICATE-/p' >> /c/Program\ Files/Git/mingw64/ssl/certs/ca-bundle.trust.crt 以管理员身份关闭Git Bash 启动Git Bash(不是管理员) 在MINGW64终端中运行: $ git配置——global http。sslBackend schannel $ git配置——global http。sslverify真实
基于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
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo update-ca-certificates
对我有用。
今天我在freedesktop.org上使用Git for Windows时遇到了这个问题。我把git版本从2.28更新到2.35,问题就解决了。可能是windows版本的集成shell环境没有更新的证书。
希望这对使用Windows版本的用户有所帮助。