git fatal error: Unsupported SSL backend 'schannel'
Asked Answered
C

7

21

Note, this question was meant for Using Git Bash under WSL under Windows for the MS TFS Git server, and I am still not clear what environment the top voted answer is under, so I'm still keeping my chosen answer as the answer.

Trying to access git-bash prepared git repo with canonical git, and I'm getting:

$ git pull
fatal: Unsupported SSL backend 'schannel'. Supported SSL backends:
        gnutls

Following Using Git Bash under WSL, I've done git config http.sslBackend openssl:

$ git config http.sslBackend 
openssl

$ git config --global http.sslBackend
openssl

Following tip from reddit, I've done:

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

What else I'm missing?

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

Run within Windows WSL.

PS. After all above tweaking, git-bash can still pull this git repo just fine, so I guess the SSL backend 'schannel' is configured somewhere else in this repo.

PPS. Found that it has nothing to do with "git-bash prepared git repo", as even cloning a fresh one will give me the exact same error.

Here is my git config --show-origin -l output, let me know if I need to include more:

$ 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
Cauley answered 29/3, 2021 at 22:16 Comment(3)
Can you edit your question to include the output of git config --show-origin -l?Fictive
We're looking for anything related to http.sslBackend.Fictive
I hit the same issue on Windows under Cygwin. Setting http.sslBackend to openssl do the work. git config --global http.sslBackend opensslThackeray
F
11

In general, the http.sslBackend option is only usable on Windows. Most Linux distros don't offer it as an option, since they don't compile with multiple TLS libraries.

The proper solution is to remove all of the http.sslBackend options:

$ git config --unset-all http.sslBackend

If you must use OpenSSL for some reason, you'll need to compile with it yourself. Most Linux distros are legally prohibited from distributing Git linked to OpenSSL under the GPLv2, so they typically don't do that.

Fictive answered 30/3, 2021 at 0:58 Comment(2)
Just FTA, git config --unset-all http.sslBackend was somehow unable to remove the entry in ~/.gitconfig. After removing it myself manually, everything is working fine now. thank you sir.Cauley
I echo with @xpt, got it sorted after manually updating the .gitconfig fileLeathers
D
22

As the solution provided by @bk2204 didn't work for me i tried to change it manually to "gnutls" value and it worked.

1- I tried @bk2204 fix but it didn't work for me.

git config --unset-all http.sslBackend

2- tried to set http.sslBackend to "openssl"

git config --global http.sslBackend "openssl"

Nope

3- "If the cmd is proposing gnutls, why not use it?

git config --global http.sslBackend "gnutls" It doesn't work either

4- Change it manually!

cmd: vim ~/.gitconfig Replace the value of http sslBackend to gnutls

Tadá!

.gitconfig result

[http]
        sslBackend = gnutls
Daron answered 20/5, 2021 at 17:53 Comment(4)
I don't know why this would fail with the git config --global setup since that should write your personal .gitconfig. What error message occurs with git config --global, if any? What file(s) did it write?Subreption
no error messages, it just didn't workDaron
Did you try the first option but with the global tag? something like git config --global --unset http.sslBackend worked for meAugustin
I didn't, just tried the mentioned stepsDaron
F
11

In general, the http.sslBackend option is only usable on Windows. Most Linux distros don't offer it as an option, since they don't compile with multiple TLS libraries.

The proper solution is to remove all of the http.sslBackend options:

$ git config --unset-all http.sslBackend

If you must use OpenSSL for some reason, you'll need to compile with it yourself. Most Linux distros are legally prohibited from distributing Git linked to OpenSSL under the GPLv2, so they typically don't do that.

Fictive answered 30/3, 2021 at 0:58 Comment(2)
Just FTA, git config --unset-all http.sslBackend was somehow unable to remove the entry in ~/.gitconfig. After removing it myself manually, everything is working fine now. thank you sir.Cauley
I echo with @xpt, got it sorted after manually updating the .gitconfig fileLeathers
D
10
$ git config --unset-all http.sslBackend
$ fatal: not in a git directory


$ git config --global --unset http.sslBackend

Add --global to solve the problem

Dubrovnik answered 23/8, 2023 at 1:53 Comment(0)
R
1

Got this error on Windows trying to create a remote branch from the local branch

git push --set-upstream origin Dev

Resolved

  1. Set SSL backend explicitly: Open a command prompt or Git Bash and set the http.sslBackend configuration option to 'schannel' explicitly. Run the following command:

git config --global http.sslBackend schannel

This command instructs Git to use the 'schannel' SSL backend explicitly.

  1. Verify SSL backend: To verify that the SSL backend has been set correctly, you can use the following command:

git config --global http.sslBackend

It should display 'schannel' as the output.

Regularize answered 28/6, 2023 at 15:9 Comment(2)
hmm... please explain a bit more on how it can possibly solve the problem of fatal: Unsupported SSL backend 'schannel'. thx.Cauley
schannel only works on Windows version of Git (not WSL)Disapprobation
S
0

Workaround solution that resolved this issue is to remove all the configuratios from --global and --system.

Added required configuration one by one.

Singhalese answered 7/11, 2022 at 14:30 Comment(0)
H
0

I am using Windows. In my case, the configuration updates suggested here didn't resolve it. Eventually, I uninstalled Git completely (from "Add or Remove programs" wizard). Then I installed Git from here and then I was able to use again git.

Haun answered 21/5, 2023 at 10:24 Comment(0)
Z
0

Unsetting ssl.Backend as above and using the --global switch solved my problem git config --global --unset http.sslBackend

Zarate answered 23/10, 2023 at 20:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.