gnutls_handshake() failed (The TLS connection was non-properly terminated) while getting Fuchsia?

21.5k Views Asked by At

I was trying to get the Google Fuchsia source code, but I keep running into a bunch of these errors:

ERROR: 'git fetch -p origin' failed:
stdout:
stderr:
fatal: unable to access 'https://fuchsia.googlesource.com/third_party/github.com/google/cppdap/':
gnutls_handshake() failed: The TLS connection was non-properly terminated.
command fail error: exit status 128

As a result, the download never fully finishes, and I have an incomplete clone of the Fuchsia repo.

I know that my Git installation is fine because I can access GitHub repos over https just fine (I do it regularly).

I'm on WSL2 (Ubuntu 20.04 LTS).

How can I fix this error?

5

There are 5 best solutions below

0
On

I disable the sslVerify in Ubuntu. And try to clone git. It works.

git config --global http.sslVerify false
0
On

In case you still got this error , first of all I suggest to verify the current valid url from the docs

curl -s "https://fuchsia.googlesource.com/fuchsia/+/HEAD/scripts/bootstrap?format=TEXT" | base64 --decode | bash

Then try to force ipv4 with --ipv4 or update curl as described in this answer

apt-get update
apt-get install curl
0
On

In my case the issue was the incorrect value of https proxy variable. The https proxy variable(https_proxy) was using https, where it should have used http.

# WRONG:
https_proxy=https://<proxy-url>

# CORRECT
https_proxy=http://<proxy-url>
0
On

you can try

sudo git clean -i

that solved my problem for error :

git pull --tags origin main fatal: unable to access 'https:_git_repo_i_cant_reach _': gnutls_handshake() failed: Error in the pull function.

0
On

I just exit wsl2 and restart it, then solve the problem.