Windows 上的 Git ssl 错误

发布于 2024-12-06 06:27:28 字数 313 浏览 1 评论 0原文

当尝试在 Windows 上使用 ssl 克隆 git 存储库时,我不断收到以下错误:

error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

ssl 证书层次结构受信任(颁发者证书已添加到受信任的根证书颁发机构),我可以浏览到托管站点(Gitorious 的私有实例) )没有 ssl 错误。我尝试过在 Windows 7 和 Windows Server 2008 上进行克隆,但两次都失败了。

有人有什么想法吗?

I keep getting the following error when attempting to clone a git repository using ssl on windows:

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.

Anyone got any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

不离久伴 2024-12-13 06:27:28

Git 显然不接受 Windows 中保存的证书,您必须指定编辑证书文件的路径 .gitconfig

gitconfig location:

C:\Program Files (x86)\Git\etc

添加行(替换为文件的路径和 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"]
.
.
.

然后重试..

Git Apparently not take certificates saved in windows, you have to specify what editing the path to the certificate file .gitconfig

gitconfig location:

C:\Program Files (x86)\Git\etc

Add the line (replace with the path to file and yourCertificate.ctr with the name to your certificate):

.
.
.
[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..

习ぎ惯性依靠 2024-12-13 06:27:28

http.sslcainfo 的位置存储在“C:\ProgramData\Git\config”中。
卸载/重新安装 git 时它不会改变。

我最近不得不将其从 更改

sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

sslCAInfo = C:/Users/kristof/AppData/Local/Programs/Git/mingw64/ssl/certs/ca-bundle.crt

另见问题:
在 Git 中为 Windows 自己的系统范围配置配置 http.sslcainfo #531
https://github.com/git-for-windows/git/issues/531

The location of http.sslcainfo is stored in "C:\ProgramData\Git\config".
It is not altered when uninstalling/reinstalling 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

亣腦蒛氧 2024-12-13 06:27:28

确保添加到您的 Git 全局配置文件中:

 http.sslcainfo=/bin/curl-ca-bundle.crt

您的 msysgit 实例需要知道在哪里查找 CA 证书才能验证它们。

在此 SO 答案 或“无法获取Http 在 git 上工作”。

Make sure to add to your Git global config file:

 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.

See more settings in this SO answer or in "Cannot get Http on git to work".

一枫情书 2024-12-13 06:27:28

如果所有其他方法都失败,您可以将环境变量 GIT_SSL_NO_VERIFY 设置为 true。但是,希望可以通过其他方式解决该问题。 警告:这会使您面临安全风险,因为您不再相信您正在与您认为正在与之交谈的服务器进行交谈。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文