【问题标题】:Cant clone repo. Server certificate verification failed无法克隆回购。服务器证书验证失败
【发布时间】:2021-05-14 12:04:03
【问题描述】:

当我尝试通过命令克隆存储库时

git clone https://git.lighttpd.net/mirrors/libev.git

我收到一个错误 fatal: unable to access 'https://git.lighttpd.net/mirrors/libev.git/': server certificate verification failed. CAfile: none CRLfile: none

如果设置 GIT_CURL_VERBOSE=1

Cloning into 'libev'...
* Couldn't find host git.lighttpd.net in the .netrc file; using defaults
*   Trying 5.9.70.195:443...
* TCP_NODELAY set
* Connected to git.lighttpd.net (5.9.70.195) port 443 (#0)
* found 387 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
* server certificate verification failed. CAfile: none CRLfile: none
* Closing connection 0
fatal: unable to access 'https://git.lighttpd.net/mirrors/libev.git/': server certificate verification failed. CAfile: none CRLfile: none

我可以设置GIT_SSL_NO_VERIFY=1,但这并不能解决问题

附: ubuntu 20.04

【问题讨论】:

  • CAfile: none CRLfile: none 在您的机器上安装证书。
  • debian 为 git 使用 gnutls curl 库(curl 二进制文件使用 openssl 库); gnutls 默认检查 ocsp 状态,它已经过时了,因为我的“获取新的 ocsp 响应后重新启动服务器”配置被破坏。我使用gnutls-cli -p 443 git.lighttpd.net 来调试这个问题。

标签: git ssl ssl-certificate lighttpd


【解决方案1】:

正如@kamilcuk 建议的那样,请务必在您的机器上安装证书。

apt install ca-certificates

【讨论】:

    【解决方案2】:

    git clone https://git.lighttpd.net/mirrors/libev.git 在 Fedora 34 上为我工作(没有 GIT_SSL_NO_VERIFY=1)。也许您需要升级 git 包或 Ubuntu 20.04 上的 cacerts 包?

    顺便说一句,lighttpd 支持多种原生 OS 事件框架,因此与允许 lighttpd 直接使用原生 OS 事件框架相比,将 lighttpd 与 libev 一起使用是不必要的(而且通常会稍微慢一些)。

    编辑:lighttpd.net 管理员注意到站点证书的 OCSP 状态已过期,并且脚本没有更新它。这已在服务器端更正。

    【讨论】:

      【解决方案3】:

      设置 GIT_SSL_NO_VERIFY 对我有用:

      ➜  ~ GIT_SSL_NO_VERIFY=1 git clone https://git.lighttpd.net/mirrors/libev.git
      Cloning into 'libev'...
      remote: Enumerating objects: 5237, done.
      remote: Counting objects: 100% (5237/5237), done.
      remote: Compressing objects: 100% (1580/1580), done.
      remote: Total 5237 (delta 3831), reused 4987 (delta 3656)B/s
      Receiving objects: 100% (5237/5237), 1.36 MiB | 2.02 MiB/s, done.
      Resolving deltas: 100% (3831/3831), done.
      

      【讨论】:

      • 我写到它没有解决问题。
      猜你喜欢
      • 2016-09-23
      • 1970-01-01
      • 2011-07-07
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      • 2013-06-17
      • 1970-01-01
      • 2015-06-30
      相关资源
      最近更新 更多