🔨 修复加速后 Git for Windows(含 SDK、自动更新)无法访问 GitHub:本地提供 CRL 并为 MITM 证书添加吊销分发点 - #4126
Open
PtJade-Ceramic wants to merge 2 commits into
Open
PtJade-Ceramic wants to merge 2 commits into
PtJade-Ceramic wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
修复启用加速后 Git for Windows / Git for Windows SDK / Git for Windows 的自动更新无法访问GitHub 的问题(curl 报
CRYPT_E_NO_REVOCATION_CHECK (0x80092012)/curl: (35) ... schannel)。根因
加速开启后
github.com、api.github.com等域名被 hosts 指向127.0.0.1,由反代终止 TLS。反代用本地根 CA 现场签发的叶子证书缺少 CRL 分发点(CDP)扩展 —— 实测该证书No extensions in certificate,既没有 CDP 也没有 AIA。Schannel(Git for Windows 自带的curl与git.exe使用的 TLS 后端)强制检查吊销状态,拿不到吊销信息即判失败,TLS 握手因此直接被拒:
影响面
curl、git ls-remote等直接失败。Git for Windows Updater以git-bash.exe --hide --no-needs-console --command=cmd\git.exe update-git-for-windows --quiet --gui运行;git-update-git-for-windows的http_get()拿到退出码 35 后走case $?,"$proxy" in 7,) ...;; *) return;;静默返回,stderr 又被--hide吞掉,界面上没有任何提示,任务只留一个非零结果(实测LastTaskResult = 35),于是开启加速的用户长期收不到更新提示。git-update-git-for-windows同样没有传--ssl-revoke-best-effort,因此官方安装也一样受影响。本 PR 从服务端修复,对所有 Schannel 客户端都生效,不依赖它们各自加参数。改动
http://127.0.0.1:{CrlPort}/crl),对外提供由本地根 CA 签名的空 CRL。X509RevocationMode.Online链构建。验证
curl -v https://github.com正常返回 HTTP 200 与完整页面;git ls-remote正常拉取引用列表。临时规避(客户端侧,无需升级加速器)
在加速器更新到包含本修复的版本之前,受影响的客户端可以这样解围:
api.github.com被劫持到127.0.0.1)curl: (35) ... CRYPT_E_NO_REVOCATION_CHECK (0x80092012),退出码 35--ssl-revoke-best-effort--ssl-no-revokeFixes #4123