4

On one particular host, I cannot git clone any GitHub repo over https:

git clone https://github.com/llvm/llvm-project.git
Cloning into 'llvm-project'...
fatal: unable to access 'https://github.com/llvm/llvm-project.git/': Failed sending HTTP request

Everything similar I've found talks about SSL server cert verification failing (e.,g. here or here). Running the command under strace does indicate the command rifling through all my certs before failing, but the http.sslVerify => false hack has no effect (just like the second question above).

I've reinstalled the git & ca-certificates packages; no effect.

Anyone have any thoughts? Even suggestions as to how to induce git to tell me more about what's going wrong would be appreciated.

sp1ff
  • 95
  • 1
  • 5

4 Answers4

5

Had the same problem with another solution. I post this answer since this problem smh appeared on all my MX Linux boxes at the same time. In my case it was a mismatched version that could be resolved with the solution from here.

# apt reinstall libcurl3-gnutls/stable did the trick.

It's recommended to have the debian/security apt repos active for this.

Edit: See the answer from gpweb cgti for a more in-depth and permanent solution

Cobalt
  • 447
  • 5
  • 9
4

If you git version is recent enough, you can use trace2 to display what Git is trying to do:

GIT_TRACE2=1 git clone https://...
GIT_TRACE2_EVENT=1 git clone https://...

I suspect a different (older) libcurl on your host, compared to other ones, which would result in HTTP request being not sent.

You can also, in /usr/bin, check the dynamic library dependencies of git:

ldd git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Yup-- that did it. The culprit was not `libcurl`, but some combination of `libgnutls`, `libnettle`, and/or `libhogweed`-- somewhere along the line I built them from source & installed them into `/usr/local/lib`-- git on the bad host was picking them up from there. Moved them away, ran `ldconfig` and `git` worked again. Thanks! – sp1ff Jan 04 '21 at 03:32
4

Same problem here on Debian Buster!

The problem is reported here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987187

My computer was like that:

DEBIAN10$ apt policy curl:amd64 libcurl4:amd64 libcurl3-gnutls:amd64
curl:
  Instalado: 7.74.0-1.2~bpo10+1
  Candidato: 7.74.0-1.2~bpo10+1
  Tabela de versão:
 *** 7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
libcurl4:
  Instalado: 7.74.0-1.2~bpo10+1
  Candidato: 7.74.0-1.2~bpo10+1
  Tabela de versão:
 *** 7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
libcurl3-gnutls:
  Instalado: 7.64.0-4+deb10u2
  Candidato: 7.64.0-4+deb10u2
  Tabela de versão:
     7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
        100 /var/lib/dpkg/status

Then, I did the trick!

DEBIAN10$ apt reinstall libcurl3-gnutls/stable

And it is ok now! (thanks @Cobalt)

My config after the change:

DEBIAN10$ apt policy curl:amd64 libcurl4:amd64 libcurl3-gnutls:amd64
curl:
  Instalado: 7.74.0-1.2~bpo10+1
  Candidato: 7.74.0-1.2~bpo10+1
  Tabela de versão:
 *** 7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
libcurl4:
  Instalado: 7.74.0-1.2~bpo10+1
  Candidato: 7.74.0-1.2~bpo10+1
  Tabela de versão:
 *** 7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
libcurl3-gnutls:
  Instalado: 7.64.0-4+deb10u2
  Candidato: 7.64.0-4+deb10u2
  Tabela de versão:
     7.74.0-1.2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 7.64.0-4+deb10u2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
        100 /var/lib/dpkg/status

Besides, add the content bellow to the /etc/apt/preferences.d/99debian-backports file, in order to avoid returning to the problem in the next upgrade!

/etc/apt/preferences.d/99debian-backports
Package: *
Pin: release a=buster-backports
Pin-Priority: 900

Package: libcurl3-gnutls:amd64
Pin: release a=stable
Pin-Priority: 901
gpweb cgti
  • 51
  • 3
1

For some unknown reason the solution before is not working anymore.
Now, it seams to be fine.

sudo apt-get -t buster reinstall libcurl3-gnutls:amd64=7.64.0-4+deb10u2
sudo apt-mark hold libcurl3-gnutls
gpweb cgti
  • 51
  • 3