Linux升级openssl版本
openssl官方下载网址:https://www.openssl.org/source/
以RedHat 7.9升级为例子。
安装依赖包:
yum install -y gcc gcc-c++ glibc make autoconf pcre-devel pam-devel automake makedepend perl-Test-Simple perl zlib zlib-devel
备份openssl:
find / -name openssl mv /usr/bin/openssl /usr/bin/openssl.bak mv /etc/pki/ca-trust/extracted/openssl /etc/pki/ca-trust/extracted/openssl.bak mv /usr/lib64/openssl /usr/lib64/openssl.bak [root@dm8 soft]# find / -name openssl /etc/pki/ca-trust/extracted/openssl /usr/bin/openssl /usr/lib64/openssl [root@dm8 soft]# mv /usr/bin/openssl /usr/bin/openssl.bak [root@dm8 soft]# mv /etc/pki/ca-trust/extracted/openssl /etc/pki/ca-trust/extracted/openssl.bak [root@dm8 soft]# mv /usr/lib64/openssl /usr/lib64/openssl.bak
解压,编译安装:
openssl version tar -zxvf openssl-1.1.1k.tar.gz cd openssl-1.1.1k ./config shared -fPIC make depend make make test make install echo $? cp -rvf include/openssl /usr/include/ ln -s /usr/local/bin/openssl /usr/bin/openssl ln -snf /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so ln -snf /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1 ln -snf /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so ln -snf /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1 echo "/usr/local/lib64" >> /etc/ld.so.conf ldconfig openssl version [root@dm8 soft]# openssl version OpenSSL 1.0.2k-fips 26 Jan 2017 [root@dm8 soft]# tar -zxvf openssl-1.1.1k.tar.gz [root@dm8 soft]# cd openssl-1.1.1k [root@dm8 openssl-1.1.1k]# ./config shared -fPIC [root@dm8 openssl-1.1.1k]# make depend [root@dm8 openssl-1.1.1k]# make [root@dm8 openssl-1.1.1k]# make test [root@dm8 openssl-1.1.1k]# make install [root@dm8 openssl-1.1.1k]# echo $? [root@dm8 openssl-1.1.1k]# cp -rvf include/openssl /usr/include/ [root@dm8 openssl-1.1.1k]# ln -s /usr/local/bin/openssl /usr/bin/openssl [root@dm8 openssl-1.1.1k]# ln -snf /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so [root@dm8 openssl-1.1.1k]# ln -snf /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1 [root@dm8 openssl-1.1.1k]# ln -snf /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so [root@dm8 openssl-1.1.1k]# ln -snf /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1 [root@dm8 openssl-1.1.1k]# echo "/usr/local/lib64" >> /etc/ld.so.conf [root@dm8 openssl-1.1.1k]# ldconfig [root@dm8 openssl-1.1.1k]# openssl version OpenSSL 1.1.1k 25 Mar 2021
参考链接:
http://www.jinbuguo.com/linux/openssl_install.html
https://www.cnblogs.com/wangyang0210/p/12552040.html