Git - 撤销功能无法检查证书的撤销

标签 git github

我正在尝试使用 Github Desktop 和 git shell 从 Github 克隆,但不断收到此错误:

Cloning into 'C:\Users\John Doe\workspace\MyProject'...
fatal: unable to access 'https://github.com/JohnDoe/MyProject.git/': 
schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - 
The revocation function was unable to check revocation for the certificate.

pull 现有存储库时出现同样的问题。

我已经尝试将在 ~/.ssh/github-ssh.pub 中找到的 SSH key 上传到 Github 设置,但它没有任何帮助。

编辑:刚刚检查过,即使我尝试克隆一个不存在的存储库,它也会发生。

最佳答案

当您在对所有流量执行 MITM 然后阻止吊销检查的公司网络上时,通常也会遇到此错误。 显然,理想情况是不阻止检查(或至少不阻止 url 白名单),但可能需要解决此问题。

一个选项是,如迈克回答的第一部分,using the OpenSSL bindings instead .虽然这可行,但它需要手动维护证书列表,这在极端情况下可能不切实际(例如,每天都会发布新的根证书,尽管这不太可能)。

另一个选项,类似于迈克回答的第二部分,是禁用撤销检查。
git-for-windows 的最新版本 2.19 及更高版本提供了一个 http.schannelCheckRevoke setting :

Used to enforce or disable certificate revocation checks in cURL when http.sslBackend is set to "schannel". Defaults to true if unset. Only necessary to disable this if Git consistently errors and the message is about checking the revocation status of a certificate. This option is ignored if cURL lacks support for setting the relevant SSL option at runtime.

...所以你可以简单地首先禁用检查撤销:
git config --global http.schannelCheckRevoke false

请注意,与完全禁用 SSL 不同,这在本质上并不比使用 Mike 对特定存储库的回答更不安全:如果您捕获并配置一个空的撤销列表(通常情况),您实际上已经禁用了撤销检查。 Disabling revocation checking only becomes a risk in the case of private-key compromise (在链中的某个点),这是罕见且困难的。

另请注意,在企业 MITM 设置中,正在为您执行吊销检查:没有值得使用的代理会为无效或(已知)受损证书颁发证书。

关于Git - 撤销功能无法检查证书的撤销,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45556189/

相关文章:

git - "git pull"是如何用 git2-rs Rust crate 完成的?

git - 第二个帐户/ repo 推送问题

git - 如何修复 GitHub 中的 "Fetch to Code Inspector failed"?

Git GPG 签名失败,没有明确消息

ruby-on-rails - Heroku:将 Rails 应用程序推送到 Heroku 时出错,Heroku 找不到 Rails 应用程序

github - 在 github 上不提交就测试 travis-ci 脚本

github - Jenkins 失败并显示 github "git clone"

github - Github Bio 中换行符的正确语法

java - 如何修复这个 Maven 依赖 hell

git - 为什么 pull 的时候会出现pull requests