git 致命错误:不支持的 SSL 后端“schannel”

xpt*_*xpt 3 git configuration windows-subsystem-for-linux

尝试git-bash使用 canonical访问准备好的 git repo git,我得到:

$ git pull
fatal: Unsupported SSL backend 'schannel'. Supported SSL backends:
        gnutls
Run Code Online (Sandbox Code Playgroud)

WSL 下使用 Git Bash之后,我完成了git config http.sslBackend openssl

$ git config http.sslBackend 
openssl

$ git config --global http.sslBackend
openssl
Run Code Online (Sandbox Code Playgroud)

按照reddit 的提示,我已经完成了:

sudo apt install -y gnutls-bin

# and here are my installed packages:
ii gnutls-bin  amd64 GNU TLS library - commandline utilities
ii libcurl3-gnutls:amd64  amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libgnutls-dane0:amd64  amd64 GNU TLS library - DANE security support
ii libgnutls30:amd64  amd64 GNU TLS library - main runtime library
Run Code Online (Sandbox Code Playgroud)

我还缺少什么?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
Run Code Online (Sandbox Code Playgroud)

在 Windows WSL 中运行。

附注。经过上述所有调整,这个 git repogit-bash仍然可以pull正常工作,所以我猜它SSL backend 'schannel'是在这个 repo 的其他地方配置的。

聚苯乙烯。发现它与git-bashprepared git repo”无关,因为即使克隆一个新的也会给我完全相同的错误。

这是我的git config --show-origin -l输出,让我知道是否需要包含更多内容:

$ git config --show-origin -l | grep -E 'ssl|http'
file:/home/me/.gitconfig        http.sslbackend=openssl
file:.git/config        http.sslverify=false
file:.git/config        http.sslbackend=openssl
file:.git/config        http.emptyauth=true
file:.git/config        remote.origin.url=http://xxx:8080/tfs/DefaultCollection/xxx
file:.git/config        lfs.http://xxx:8080/tfs/DefaultCollection/xxx/info/lfs.access=ntlm
Run Code Online (Sandbox Code Playgroud)

Mar*_*ate 18

由于 @bk2204 提供的解决方案对我不起作用,我尝试将其手动更改为“gnutls”值并且它有效。

\n

1-我尝试了@bk2204修复,但它对我不起作用。

\n
\n

git config --unset-all http.sslBackend

\n
\n

2-尝试将http.sslBackend设置为“openssl”

\n
\n

git config --global http.sslBackend“openssl”

\n
\n

没有

\n

3-“如果 cmd 建议使用 gnutls,为什么不使用它呢?

\n
\n

git config --global http.sslBackend "gnutls"\n它也不起作用

\n
\n

4-手动更改!

\n
\n

cmd: vim ~/.gitconfig\n将 http sslBackend 的值替换为 gnutls

\n
\n

达\xc3\xa1!

\n

.gitconfig 结果

\n
[http]\n        sslBackend = gnutls\n
Run Code Online (Sandbox Code Playgroud)\n


bk2*_*204 5

通常,该http.sslBackend选项仅在 Windows 上可用。大多数 Linux 发行版不提供它作为选项,因为它们不使用多个 TLS 库进行编译。

正确的解决方案是删除所有http.sslBackend选项:

$ git config --unset-all http.sslBackend
Run Code Online (Sandbox Code Playgroud)

如果出于某种原因必须使用 OpenSSL,则需要自己编译。大多数 Linux 发行版在法律上都被禁止在 GPLv2 下分发链接到 OpenSSL 的 Git,因此他们通常不会这样做。

  • 只是 FTA,“git config --unset-all http.sslBackend”不知何故无法删除“~/.gitconfig”中的条目。自己手动删除后,现在一切正常。谢谢你,先生。 (6认同)