有一臺(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)題解決。