首页 > 解决方案 > 在证书错误中安装 Git for Windows 失败

问题描述

我正在尝试在 Windows10 上安装 Git,但无法克服证书错误。命令提示符中的错误事件如下。

git clone http://-----.git
cloning into '-----'
fatal:UriFormatException encountered
  queryURL
Password for '[proxy]':
fatal:unable to access 'https://----git':error setting certificate verify location
CAfile C:\XX\YY\ZZ\ca-bundle.crt
CApath:none

ca-bundle.crtC:\XX\ZZ目录中,而不是在上面的目录中。
令人惊讶的是, 尽管 gitconfig 文件被成功重写,但既没有git config --global http.sslcainfo "C:\XX\ZZ\ca-bundle.crt"也没有改变任何结果。 有什么建议或信息需要帮助吗?git config --global http.sslVerify false

现在有更多
git config --global --edit节目

 [http]
  proxy=------
  sslCAinfo=----

但是git clone命令给我带来了同样的错误。

标签: git

解决方案


你可以在这里找到答案

您可以设置GIT_SSL_NO_VERIFYtrue

GIT_SSL_NO_VERIFY=true git clone https://example.com/path/to/git

或者将 Git 配置为不在命令行上验证连接:

git -c http.sslVerify=false clone https://example.com/path/to/git

请注意,如果您不验证 SSL/TLS 证书,那么您很容易受到中间人攻击


推荐阅读