openssl升级

参考
https://www.cnblogs.com/shareHistory/p/15850707.html

下载并安装依赖

wget https://www.openssl.org/source/openssl-3.0.5.tar.gz
yum -y install perl-IPC-Cmd

编译安装

./config -Wl,-rpath=/usr/local/openssl/lib -fPIC --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
make depend 
make -j 2 
make install

备份旧版本openssl

mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
mv /usr/lib64/openssl /usr/lib64/openssl.bak
rm -f /usr/lib64/libssl.so.10
rm -f /usr/lib64/libcrypto.so.10

添加软连接

ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -sf /usr/local/openssl/include/openssl /usr/include/openssl

添加OpenSSL动态链接库并使其生效

echo "/usr/local/openssl/lib64" >> /etc/ld.so.conf.d/openssl-renwole.com.conf
ldconfig

查看openssl版本

openssl version
OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022)

你可能感兴趣的:(系统,linux)