我可以通过使用ssh的克隆项目推送,但它不工作时,我克隆项目与https。

它显示的错误信息是:

server certificate verification failed. CAfile: /etc/ssl/certs/cacertificates.crt CRLfile: none

当前回答

让我们加密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的内容,并重新加载服务器。

其他回答

注意:这具有重大的安全影响。

打开终端,执行以下命令:

export GIT_SSL_NO_VERIFY=1

它为我工作,我使用Linux系统。

我在树莓派2上安装了Xubuntu,发现时间上也有同样的问题,NTP和自动服务器同步是关闭的(或者没有安装)。得到国家结核控制规划

sudo apt-get install ntp

将“时间及日期”由“手动”改为“与互联网服务器保持同步”

让我们加密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的内容,并重新加载服务器。

或者简单地运行这个注释来添加服务器证书到你的数据库:

echo $(echo -n | openssl s_client -showcerts -connect yourserver.com:YourHttpGilabPort 2>/dev/null  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') >> /etc/ssl/certs/ca-certificates.crt

然后再做git克隆。

Linux/Debian使用:

sudo cp /etc/ca-certificates.conf /etc/ca-certificates.conf.orig
sudo nano /etc/ca-certificates.conf
Change “mozilla/DST_Root_CA_X3.crt” in “!mozilla/DST_Root_CA_X3.crt” an save
sudo update-ca-certificates

https://talk.plesk.com/threads/lets-encrypt-root-certificate-expiration-on-30-september-2021.362224/