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

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?



Solution 1:[1]

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

Solution 2:[2]

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

git config --global http.sslVerify false

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stefano Sansone
Solution 2 Zgpeace