Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone always fails with "Failed sending HTTP request"

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.

like image 963
sp1ff Avatar asked Dec 23 '22 16:12

sp1ff


2 Answers

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

like image 153
Cobalt Avatar answered Jan 17 '23 21:01

Cobalt


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
like image 28
VonC Avatar answered Jan 17 '23 20:01

VonC