git OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version的解決

有一臺(tái)很老服務(wù)器,使用的是centos5的系統(tǒng)

由于github升級(jí)了openssl,停用了tlsv1.1,git使用的時(shí)候就會(huì)出現(xiàn)

#git clone https://github.com/esnet/iperf.git

Cloning into iperf...

error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/esnet/iperf.git/info/refs

看看詳細(xì)信息:

#GIT_CURL_VERBOSE=1 git clone https://github.com/esnet/iperf.git

Cloning into iperf...

* Couldn't find host github.com in the .netrc file; using defaults

* About to connect() to github.com port 443 (#0)

*? Trying 13.229.188.59... * Connected to github.com (13.229.188.59) port 443 (#0)

* successfully set certificate verify locations:

*? CAfile: none

? CApath: /etc/ssl/certs/

* error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

* Closing connection #0

* Couldn't find host github.com in the .netrc file; using defaults

* About to connect() to github.com port 443 (#0)

*? Trying 13.229.188.59... * Connected to github.com (13.229.188.59) port 443 (#0)

* successfully set certificate verify locations:

*? CAfile: none

? CApath: /etc/ssl/certs/

* error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

* Closing connection #0

error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/esnet/iperf.git/info/refs

fatal: HTTP request failed


搜索了一下,大多都是說(shuō)git版本太低了,升級(jí)了一下git,結(jié)果運(yùn)行了結(jié)果還一樣。

又測(cè)試了一下,發(fā)現(xiàn)curl也存在相同的問(wèn)題。

再找,有人說(shuō)是openssl的問(wèn)題,升級(jí)之。

看了一個(gè)能用的centos系統(tǒng),openssl是1.0.2,于是下載了1.0.2r版本的

#wget?https://www.openssl.org/source/old/1.0.2/openssl-1.0.2r.tar.gz

#tar -xf?openssl-1.0.2r.tar.gz

#cd?openssl-1.0.2r

#./config shared zlib

#make -j3

#make install

需要注意的是由于沒(méi)有?指定prefix,安裝在/usr/local/ssl

#/usr/local/ssl/bin/openssl version

OpenSSL 1.0.2r 26 Feb 2019

新版本已經(jīng)可以使用,下面將老版本替換,需要將bin和lib都替換,如果還要編譯程序,則include也要替換:

mv /usr/bin/openssl /usr/bin/openssl.old

ln -s /usr/local/ssl/bin/openssl /usr/bin

mv /usr/include/openssl /usr/include/openssl.old

ln -s /usr/local/ssl/include/openssl /usr/include

cd /lib

mv libssl.so.6 libssl.so.6.old

ln -s /usr/local/ssh/lib/libssl.so?libssl.so.6

mv libcrypto.so.6?libcrypto.so.6.old

ln -s?/usr/local/ssl/lib/libcrypto.so?libcrypto.so.6

測(cè)試一下:

#openssl version

OpenSSL 1.0.2r 26 Feb 2019

說(shuō)明OK。

再運(yùn)行一下git:

#git clone https://github.com/esnet/iperf.git

Cloning into iperf...

remote: Enumerating objects: 19, done.

remote: Counting objects: 100% (19/19), done.

remote: Compressing objects: 100% (16/16), done.

receiving objects:? 28% (2120/7564), 2.46 MiB | 303 KiB/s? ?

可以正常使用了,但是同時(shí)引入了新的問(wèn)題

#ssh localhost

OpenSSL version mismatch. Built against 1000005f, you have 1000212f


ssh不能正常使用了,可以把openssh也升級(jí)一下了,這個(gè)就簡(jiǎn)單了。

至此,openssl版本太低的問(wèn)題解決。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • cocoapods安裝過(guò)3次都蜜汁失敗 在第七次終于成功 下列附上過(guò)程 有耐心的朋友可以試試的我的步驟和方法 ps...
    _Dam0n閱讀 2,693評(píng)論 0 1
  • 第一次安裝CocoaPods也遇到了一些坑,但是 那個(gè)時(shí)候時(shí)間比較緊,沒(méi)有抽出時(shí)間整理,最近因?yàn)殡娔X還原從新做了系...
    幸福的尾巴__閱讀 8,623評(píng)論 7 9
  • 更改ip和dnsVi /etc/sysconfig/network-scripts/ifcfg-eth0vi /...
    Xwei_閱讀 2,043評(píng)論 0 3
  • 寫(xiě)在前面的話: 這篇博客是我從這里“轉(zhuǎn)載”的,為什么轉(zhuǎn)載兩個(gè)字加“”呢?因?yàn)檫@絕不是簡(jiǎn)單的復(fù)制粘貼,我花了五六個(gè)小...
    SmartSean閱讀 4,945評(píng)論 12 45
  • 羅漢,是阿羅漢的簡(jiǎn)稱(chēng),梵音譯(Arhat)。含有殺賊、無(wú)生、應(yīng)供等義。殺賊是殺盡煩惱之賊,無(wú)生是解脫生死不受后有,...
    真一重九閱讀 1,517評(píng)論 0 6

友情鏈接更多精彩內(nèi)容