无法解决“无法获得本地颁发者证书”在Windows上使用git和自签名证书 [英] Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate

查看:1753
本文介绍了无法解决“无法获得本地颁发者证书”在Windows上使用git和自签名证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上使用git。我安装了msysgit包。我的测试存储库在服务器上有一个自签名证书。我可以访问和使用http没有问题的存储库。移至https会显示错误SSL证书问题:无法获取本地颁发者证书。

I am using git on Windows. I installed the msysgit package. My test repository has a self signed certificate at the server. I can access and use the repository using http without problems. Moving to https gives the error "SSL Certificate problem: unable to get local issuer certificate".

我有自签名证书安装在我的Windows 7 - 客户端机器的受信任的根证书颁发机构。我可以浏览到Internet Explorer中的https存储库网址,没有错误消息。

I have the self signed certificate installed in the Trusted Root Certification Authorities of my Windows 7 - client machine. I can browse to the https repository url in Internet Explorer with no error messages.

此博客 http://blogs.msdn.com/b /phkelley/archive/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exe-s-store.aspx 解释curl不使用客户端机的证书库。我遵循博客文章的建议,创建一个curl-ca-bundle.crt的私人副本,并配置git使用它。我确信git正在使用我的副本。如果我重命名副本; git抱怨文件丢失。

This blog http://blogs.msdn.com/b/phkelley/archive/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exe-s-store.aspx explained that curl does not use the client machine's certificate store. I followed the blog post's advice to create a private copy of curl-ca-bundle.crt and configure git to use it. I am sure git is using my copy. If I rename the copy; git complains the file is missing.

我粘贴在我的证书,如博客文章所述,我仍然收到消息无法获得本地颁发者证书。

I pasted in my certificate, as mentioned in the blog post, I still get the message "unable to get local issuer certificate".

我确认git仍然通过https克隆GitHub存储库。

I verified that git was still working by cloning a GitHub Repository via https.

我看到的只有不同的博客文章是我的证书是根 - 没有链达到它。我的证书最初来自单击IIS8 IIS管理器链接创建自签名证书。也许这使得证书在某种程度上与curl期望有所不同。

The only thing I see that's different to the blog post is that my certificate IS the root - there is no chain to reach it. My certificate originally came from clicking the IIS8 IIS Manager link 'Create Self Signed Certificate'. Maybe that makes a certificate different in some way to what curl expects.

如何让git / curl接受自签名证书?

How can I get git/curl to accept the self signed certificate?

推荐答案

此问题的答案使用makecert for Development SSL 为我修复了这个问题。

The answer to this question Using makecert for Development SSL fixed this for me.

我不知道为什么,在IIS管理器中创建自签名证书链接不会做的伎俩。我遵循在创建和安装自签名CA根的链接问题中的方法;然后使用它为我的服务器颁发服务器验证证书。我在IIS中安装了他们两个。

I do not know why, but the certificate created by the simple 'Create Self Signed Certificate' link in IIS Manager does not do the trick. I followed the approach in the linked question of creating and installing a self-signed CA Root; then using that to issue a Server Authentication Certificate for my server. I installed both of them in IIS.

这使我的情况与原始问题中引用的博文相同。一旦根证书被复制/粘贴到curl-ca-bundle.crt中,git / curl组合被满足。

That gets my situation the same as the blog post referenced in the original question. Once the root certificate was copy/pasted into curl-ca-bundle.crt the git/curl combo were satisfied.

这篇关于无法解决“无法获得本地颁发者证书”在Windows上使用git和自签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆