【原创】解决git clone时报告“CRLfile:none“错误的问题

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).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

daway

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值