windows - 如何将 Git 配置为信任来自 Windows 证书存储的证书?

标签 windows git ssl-certificate certificate-store

目前,我的用户目录中的 .gitconfig 中有以下条目。

...
[http]
    sslCAInfo=C:\\Users\\julian.lettner\\.ssh\\git-test.pem
...

这设置了与 git 服务器交互时使用的证书(我公司的 git 服务器需要)。

但现在我无法克隆其他存储库(例如 GitHub 上的公共(public)存储库),因为客户端始终使用被其他服务器拒绝的已配置证书。

如何规避此认证问题?我可以将 Git 配置为使用 Windows 证书存储进行身份验证吗?

最佳答案

从 Git for Windows 2.14 开始,您现在可以将 Git 配置为使用内置 Windows 网络层 SChannel。这意味着它将使用 Windows 证书存储机制,您不需要显式配置 curl CA 存储机制。

来自 Git for Windows 2.14 release notes :

It is now possible to switch between Secure Channel and OpenSSL for Git's HTTPS transport by setting the http.sslBackend config variable to "openssl" or "schannel"; This is now also the method used by the installer (rather than copying libcurl-4.dll files around).

安装Git for Windows 2.14时可以选择新的SChannel机制。您还可以通过运行更新现有安装以使用 SChannel:

git config --global http.sslBackend schannel

一旦你配置了它,Git 将使用 Windows 证书存储并且不应该要求(事实上,应该忽略)http.sslCAInfo 配置设置。

关于windows - 如何将 Git 配置为信任来自 Windows 证书存储的证书?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16668508/

相关文章:

c++ - 获取 LNK2001 但 Intellisense 可以找到功能

c++ - CMake "make install"或在 Windows 中包含一个库

Git 颜色 : How do I set colors for the upstream branch in “git branch -vv” ?

使用自定义域的 Firebase 托管具有指向 firebase.com 的 SSL 证书

java - 如何在 Websphere Application Server 中禁用或减少 SSL 日志记录

python - 动态 tkinter 输入框

windows - golang : cross platform path. 目录

Git错误: "is in submodule"

c# - PowerShell 脚本上的 Git 命令 - 授权

certificate - 如何强制 makecert 将私钥输出到文件(而不是加密存储)?