简体   繁体   English

Git - “SSL证书问题:证书链中的自签名证书”

[英]Git - “SSL certificate issue: self signed certificate in certificate chain”

I just started getting this error when trying to push my changes. 我刚开始尝试推动更改时遇到此错误。 I don't know what changed on my system and there should not be any self-signed certs in this connection. 我不知道我的系统有什么变化,在这方面不应该有任何自签名证书。

Git has been uninstalled and re-installed. Git已经卸载并重新安装。 Git appears to be using the proper bundle: http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt Git似乎使用了正确的捆绑包: http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

Disabling cert checking is not an option. 禁用证书检查不是一种选择。

How can I troubleshoot this issue? 我该如何解决这个问题?

The goal is to push my code to GitHub, but how did a self-signed cert get into this connection and how do I get it out? 目标是将我的代码推送到GitHub,但是自签名证书如何进入此连接以及如何将其解决?

I discovered that Kaspersky antivirus started using self-signed certificates in their "Web Anti-Virus" feature which caused Git to complain. 我发现卡巴斯基反病毒软件开始在他们的“Web反病毒”功能中使用自签名证书,导致Git抱怨。

In order to work with the remote in any way over HTTP (push, fetch, pull, etc.) Kaspersky Web Anti-Virus needs to be disabled or that particular Git repo added to the exclusions list. 为了通过HTTP(推送,提取,拉取等)以任何方式使用遥控器,需要禁用卡巴斯基Web反病毒或将特定的Git仓库添加到排除列表中。

First, you have the option to switch to ssh, provided you have generated a simple (no passphrase for now, just for testing) private SSH key and publish your public SSH key to your account : 首先,您可以选择切换到ssh,前提是您生成了一个简单的(现在没有密码短语,仅用于测试)私有SSH密钥并将您的公共SSH密钥发布到您的帐户

git remote set-url git@github.com:me/myrepo.git

But regarding your current issue, try first pushing after setting a simplified path : 但是关于当前的问题,请在设置简化路径后首先尝试:

set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\

By using the smallest PATH (for testing), you ensure that only your Git is used, and it should be able to push to GitHub. 通过使用最小的PATH(用于测试),您可以确保只使用Git,并且它应该能够推送到GitHub。

I had the same exact issue but used a different solution. 我有同样的问题,但使用了不同的解决方案。 Rather than disable the Web Anti-virus or rely on exclusions, I added the Kaspersky certificate to my Git for windows trust store. 我没有禁用Web防病毒或依赖排除,而是将Kaspersky证书添加到我的Git for Windows信任存储中。

Finding the Kaspersky certificate was not that straight-forward. 找到卡巴斯基证书并不是那么简单。 In my Kaspersky version, it was buried at the below location: 在我的卡巴斯基版本中,它被埋在以下位置:

Settings > Additional > Network > Encrypted connections scanning - Advanced Settings > Install Certificate > Show Certificate > Details > Copy to File > Base-64 encoded X.509 (.cer) 设置>其他>网络>加密连接扫描 - 高级设置>安装证书>显示证书>详细信息>复制到文件> Base-64编码X.509(.cer)

Once you have the certificate, you need to locate your Git trust store, then add it there. 获得证书后,您需要找到您的Git信任存储区,然后将其添加到那里。 Reference here for details. 详情请参考此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SSL 证书问题:证书链中的自签名证书 - SSL certificate problem: self signed certificate in certificate chain Azure DEVOPS 中的 GIT 错误 - SSL 证书问题:证书链中的自签名证书推送 - GIT error in Azure DEVOPS - SSL certificate problem: self signed certificate in certificate chain Pushing 与Jenkins的GIT失败,错误为“证书链中的自签名证书” - GIT with Jenkins failed with error “self signed certificate in certificate chain” 无法访问“https://github.com/user name/projectName.git/”:SSL 证书问题:证书链中的自签名证书 - unable to access 'https://github.com/user name/projectName.git/': SSL certificate problem: self signed certificate in certificate chain GitHub证书链中的自签名证书 - Self signed certificate in certificate chain with GitHub 如何让Git接受我自己签署的SSL证书? - How to get Git accept my self signed SSL certificate? Android Studio 到 BitBucket 推送错误 - 证书链中的自签名证书 - Android Studio to BitBucket push error - self signed certificate in certificate chain Git 存储库中的 R studio 项目,自签名证书问题 - R studio project from Git repository, self signed certificate issue git SSL证书-访问时无效的证书链 - git SSL certificate- Invalid certificate chain while accessing Eclipse Git自签名证书错误 - Eclipse Git self signed certificate error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM