Daway.Huang(黄伟) 2024-02-28
1、问题描述
在执行"git clone"命令克隆网站上远程仓库时报告服务器证书验证失败,没有CRLfile。
(1)使用https方式clone 时
$ git clone https://github.com/brektrou/rtl8821CU.git
正克隆到 'rtl8821CU'...
fatal: 无法访问 'https://github.com/brektrou/rtl8821CU.git':server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
(2)使用ssh方式clone时
$ git clone git@gitee.com:daway/rtl8821CU.git
正克隆到 'rtl8821CU'...
kex_exchange_identification: read: Connection reset by peer
fatal: 无法读取远程仓库。
请确认您有正确的访问权限并且仓库存在。
2、原因分析
根本原因是计算机不信任对远程服务器(Gitlab/Gitee/Github)上使用的证书进行签名的证书颁发机构。这并不意味着证书可疑,它可以是自签名的,也可以由不在系统的CA列表中的机构/公司签名。
curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs).
#curl默认情况下使用“捆绑包”执行SSL证书验证,证书颁发机构(CA)公共密钥(CA证书)。
If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option.
#如果默认捆绑文件不足,您可以指定备用文件使用--cacert选项。
If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL).

最低0.47元/天 解锁文章
4731

被折叠的 条评论
为什么被折叠?



