Windows 上的 Git ssl 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7526182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git ssl error on windows
提问by Jimit
I keep getting the following error when attempting to clone a git repository using ssl on windows:
尝试在 Windows 上使用 ssl 克隆 git 存储库时,我不断收到以下错误:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
The ssl certificate hierarchy is trusted (the issuer certificate is added to Trusted Root Certificate Authorities) and I can browse to the hosting site (a private instance of Gitorious) without ssl errors. I've tried cloning on Windows 7 and on Windows Server 2008 and it's failed both times.
ssl 证书层次结构是可信的(颁发者证书已添加到受信任的根证书颁发机构),我可以浏览到托管站点(Gitorious 的私有实例)而不会出现 ssl 错误。我曾尝试在 Windows 7 和 Windows Server 2008 上进行克隆,但两次都失败了。
Anyone got any ideas?
有人有任何想法吗?
回答by Guillermo Zacur
Git Apparently not take certificates saved in windows, you have to specify what editing the path to the certificate file .gitconfig
Git 显然不取windows 中保存的证书,你必须指定编辑证书文件的路径.gitconfig
gitconfig location:
gitconfig 位置:
C:\Program Files (x86)\Git\etc
Add the line (replace with the path to file and yourCertificate.ctr with the name to your certificate):
添加以下行(用文件路径替换,用证书名称替换 yourCertificate.ctr):
.
.
.
[help]
format = html
[http]
sslVerify = true
sslCAinfo = C:/Program Files (x86)/Git/bin/curl-ca-bundle.crt
sslCAinfo = [route]/yourCertificate.crt
[sendemail]
smtpserver = /bin/msmtp.exe
[diff "astextplain"]
.
.
.
and try again..
然后再试一次..
回答by Kristof Neirynck
The location of http.sslcainfo is stored in "C:\ProgramData\Git\config". It is not altered when uninstalling/reinstalling git.
http.sslcainfo 的位置存储在“C:\ProgramData\Git\config”中。卸载/重新安装 git 时不会改变它。
I recently had to change it from
我最近不得不改变它
sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
to
到
sslCAInfo = C:/Users/kristof/AppData/Local/Programs/Git/mingw64/ssl/certs/ca-bundle.crt
Also see issue:
Configure http.sslcainfo in Git for Windows' own system-wide config #531
https://github.com/git-for-windows/git/issues/531
另请参阅问题:
在 Git 中为 Windows 自己的系统范围配置配置 http.sslcainfo #531
https://github.com/git-for-windows/git/issues/531
回答by VonC
Make sure to add to your Git global config file:
确保添加到您的 Git 全局配置文件:
http.sslcainfo=/bin/curl-ca-bundle.crt
Your msysgit instance needs to know where to look for the CA certificates in order to validate them.
您的 msysgit 实例需要知道在哪里查找 CA 证书以对其进行验证。
See more settings in this SO answeror in "Cannot get Http on git to work".
在此SO 答案或“无法在 git 上使 Http 正常工作”中查看更多设置。
回答by Aasmund Eldhuset
If all else fails, you can set the environment variable GIT_SSL_NO_VERIFY
to true
. However, it is hopefully possible to resolve the issue in another way. WARNING:This exposes you to SECURITY RISKS, as you can no longer trust that you're talking to the server you think you're talking to.
如果所有其他方法都失败了,您可以将环境变量设置GIT_SSL_NO_VERIFY
为true
. 但是,希望有可能以另一种方式解决该问题。警告:这会使您面临安全风险,因为您无法再相信您正在与您认为正在与之交谈的服务器交谈。