目前,我的用户目录中的 .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 copyinglibcurl-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/