背景
我们的组织通过在我们的域控制器上使用组策略来分发内部证书。对于我们的 git 安装,这意味着我们需要使用“Windows 安全通道”库进行 HTTPS 连接,而不是 OpenSSL。
问题
尝试使用带有 schannel 的 VS2019 Enterprise 捆绑 Git 连接到远程 Git 存储库失败并出现错误:
schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline
当我使用 VS2019 UI 尝试与 repo 同步时,以及通过命令行运行它时,都会出现此错误。(我正在使用的可执行文件的路径是C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.exe
)
但是,如果我运行与 VS2017 捆绑的 git 可执行文件,我可以成功与 repo 同步(可执行路径:)C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.exe
。但是,如果我打开 VS2017 并尝试使用 UI,我会得到与上面相同的 schannel 错误!
概括
执行 git 的独立安装并使用 Windows 安全通道设置它成功连接到远程存储库。
无论是使用 IDE UI 还是通过命令行,VS2019 捆绑的 git 都不起作用。
VS2017 捆绑的 git 在命令行中工作,但不能通过 IDE UI。
配置文件
我的全局 .gitconfig 如下所示:
[user]
name = xxx
email = xxx@xxx.com
[http]
sslBackend = schannel
VS2019 .gitconfig 看起来像这样:
[core]
symlinks = false
autocrlf = true
[color]
diff = auto
status = auto
branch = auto
interactive = true
[pack]
packSizeLimit = 2g
[help]
format = html
[diff "astextplain"]
textconv = astextplain
[rebase]
autosquash = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[include]
; include Git for Windows' system config in order
; to inherit settings like `core.autocrlf`
path = C:/Program Files (x86)/Git/etc/gitconfig
path = C:/Program Files/Git/etc/gitconfig
VS2017 的 .gitconfig 看起来像这样(和 VS2019 完全一样):
[core]
symlinks = false
autocrlf = true
[color]
diff = auto
status = auto
branch = auto
interactive = true
[pack]
packSizeLimit = 2g
[help]
format = html
[diff "astextplain"]
textconv = astextplain
[rebase]
autosquash = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[include]
; include Git for Windows' system config in order
; to inherit settings like `core.autocrlf`
path = C:/Program Files (x86)/Git/etc/gitconfig
path = C:/Program Files/Git/etc/gitconfig