Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
935 views
in Technique[技术] by (71.8m points)

heroku - Git clone alert protocol version

I have a Git CLI with version 2.0.5, and I recently used Heroku for deploying my project.

I want to install some package on Github using Git CLI but it doesn't work. When I want to clone some repository it says

fatal: unable to access 'https://github.com/numpy/numpy': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

but when I clone my Heroku project by typing heroku git:clone project it worked and it prints text like a normal git clone.

I thought cloning Heroku project and cloning Git repo is almost same (the way Heroku clone is almost same as Git clone). Why isn't this working when I try to clone from GitHub?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your Git client is trying to use TLSv1:

routines:SSL23_GET_SERVER_HELLO:tlsv1

GitHub removed support for TLSv1 and other protocols in early 2018:

We will then restore support for the deprecated algorithms and provide a two week grace period for these systems to upgrade their libraries before we disable support for the deprecated algorithms permanently on February 22, 2018.

Git 2.0.5 is over six years old, predating this change by a bit over a year. Upgrade to a newer version of Git.

If upgrading isn't an option for some reason (I strongly suggest upgrading), you could use an SSH URL instead of an HTTPS URL:

git clone [email protected]:numpy/numpy

SSH is a completely different protocol and doesn't use TLS at all. Make sure to verify the server's host key fingerprint when prompted if you are connecting this way.

Note that GitHub removed support for this older cryptographic protocol on the server side, which means other providers may still support the older, insecure TLS protocols.

It is also possible for another tool, like the Heroku CLI, to ship its own git binary instead of using your system binary. I don't think the Heroku CLI does this, but those are two reasons that your heroku git:clone may have worked while git clone from GitHub did not.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...