无法克隆 - Git 查找不正确的证书路径



我进入了这个问题的第 5 天,没有任何运气。我已经浏览了SO中的帖子,已经报告的错误在性质上略有不同,因为它们指的是git正在寻找的错误curl ca证书,而在我的情况下,它是一个不正确的ca证书。

C:UsersDell2312Desktop>git clone 
https://sampleurl.githost.io/grp/MyProject.git
Cloning into 'MyProject'...
fatal: unable to access 'https://sampleurl.githost.io/grp/MyProject.git/': 
error setting certificate verify locations:
CAfile: C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
CApath: none

首先我不明白为什么 git 应该检查不存在的证书并抱怨我?我应该怎么做?

PS:请不要引导我浏览其他SO帖子的链接,我实际上已经逐行浏览了每个帖子。他们都没有提出造成这种情况的根本原因,也没有提供的解决方案对我有用。

更新 - 我的 git 配置的详细信息

可以看出,git 查找的路径是"C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt",实际的证书路径如下所示是 C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt

复制证书也无济于事

C:UsersDell2312Desktop>git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
diff.astextplain.textconv=astextplain
rebase.autosquash=true
http.sslcainfo=C:Program FilesGitmingw64sslcertsca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
http.sslcainfo=C:/Program Files/Git/ssl/certs/ca-bundle.crt
C:UsersDell2312Desktop>git config --global --list
http.sslcainfo=C:/Program Files/Git/ssl/certs/ca-bundle.crt

您正在使用 HTTPS 协议克隆 git 存储库,因此 git 检查证书有效性也就不足为奇了。您可以使用自定义证书颁发机构 (CA(,显然您的安装/配置存在有关 CA 位置的问题。

您的配置可以列出:

git config --list
git config --global --list

也许您设置了一些sslCA*变量?

如果您信任 sampleurl.githost.io,可以尝试跳过 SSL 验证是否适合您:

GIT_SSL_NO_VERIFY=true git clone https://sampleurl.githost.io/grp/MyProject.git

最新更新