git SSL证书-访问时无效的证书链

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23331325/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:02:25  来源:igfitidea点击:

git SSL certificate- Invalid certificate chain while accessing

gitgithub

提问by james

I'm fairly new to github and git, but I do have git setup on my Mac (using Mavericks) and have added a repo on github. I'm using MAMP and working on a Drupal site, and when I try my first push to the repo, using git push origin masterI get an error:

我对 github 和 git 还很陌生,但我的 Mac 上确实有 git 设置(使用 Mavericks),并在 github 上添加了一个 repo。我正在使用 MAMP 并在 Drupal 站点上工作,当我第一次尝试推送到 repo 时,使用时git push origin master出现错误:

error: SSL certificate problem: Invalid certificate chain while accessing
    https://githib.com/...git/info/refs?service=git-receive-pack
fatal: HTTP request failed

I've looked around to try and make sense of this error without any luck. I'd greatly appreciate any help.

我环顾四周试图理解这个错误,但没有任何运气。我将不胜感激任何帮助。

回答by thatsjoke

if you use self generated ssl key, you can try this.

如果您使用自生成的 ssl 密钥,您可以试试这个。

git config --global http.sslVerify false

Refer https://confluence.atlassian.com/display/FISHKB/Unable+to+clone+Git+repository+due+to+self+signed+certificate

参考 https://confluence.atlassian.com/display/FISHKB/Unable+to+clone+Git+repository+due+to+self+signed+certificate

回答by craigb

I recently (Jul 2014) had a similar issue and found on OS X (10.9.4) that there was a "DigiCert High Assurance EV Root CA" certificate had expired (although I had another unexpired one as well).

我最近(2014 年 7 月)遇到了类似的问题,并在 OS X (10.9.4) 上发现“DigiCert High Assurance EV Root CA”证书已过期(尽管我还有另一个未过期的证书)。

  1. Open Keychain Access
  2. search Certificatesfor "DigiCert"
  3. Viewmenu > Show Expired Certificates
  1. 打开 Keychain Access
  2. 搜索Certificates“数字证书”
  3. View菜单 > Show Expired Certificates

I found two certificates named "DigiCert High Assurance EV Root CA", one expiring Nov 2031 and the expired one at July 2014 (a few of days previously). Deleting the expired certificate resolved the issue for me.

我找到了两个名为“DigiCert High Assurance EV Root CA”的证书,一个在 2031 年 11 月到期,另一个在 2014 年 7 月(几天前)到期。删除过期的证书为我解决了这个问题。

Hope this helps.

希望这可以帮助。

回答by fpg1503

Check your clock! In my case I was using HTTPS but my clock was wrong, I disabled SSL but eventually I realized the problem was the clock. Updating the clock and reenabling SSL did the trick:

检查你的时钟!就我而言,我使用的是 HTTPS,但我的时钟错误,我禁用了 SSL,但最终我意识到问题出在时钟上。更新时钟并重新启用 SSL 就成功了:

git config --global http.sslVerify true

回答by Jake

I got this error after having been able to clone lots of repos with no problem. The problem was that I had a typo in my repo url's domain (github.om instead of github.com). I'm sure this error is correct in some way but not the most helpful for this specific problem.

在能够毫无问题地克隆大量存储库后,我收到了此错误。问题是我的 repo url 域(github.om 而不是 github.com)中有一个错字。我确信这个错误在某种程度上是正确的,但不是对这个特定问题最有帮助的。

回答by jplandrain

We had this error in one of our Git servers that was using a non self-signed certificate. We have been able to identify it and to fix it: it was caused by an intermediate certificate (GlobalSign G2 certificate) that was not registered in our reverse proxy in front of the Git server (we are using HTTPS until the reverse proxy).

我们在其中一台使用非自签名证书的 Git 服务器中出现此错误。我们已经能够识别它并修复它:它是由中间证书(GlobalSign G2 证书)引起的,该证书没有在 Git 服务器前面的反向代理中注册(我们在反向代理之前使用 HTTPS)。

This bug reporthelped us to identify the cause.

错误报告帮助我们确定了原因。

We are using nginx as reverse proxy. The official documentationgive insights.

我们使用 nginx 作为反向代理。官方文档给出了见解。

And this tutorialexplains how to fix it.

教程解释了如何修复它。

回答by Roland

Wondering when this has changed or why it worked for others, but for me the solution was basically to use httpsinstead of http:

想知道这什么时候改变了,或者为什么它对其他人有用,但对我来说,解决方案基本上是使用https而不是http

git config --global https.sslVerify false