环境说明
操作系统:CentOS Linux release 7.9.2009 (Core)
内核版本:5.14.13-1.el7.elrepo.x86_64
openssl版本:OpenSSL 1.0.2k-fips 26 Jan 2017
参考文档
个人博客:https://www.cnblogs.com/SyXk/p/15936668.html
升级openssl至3.0.2
# 准备编译环境
yum install -y zlib zlib-devel pcre pcre-devel gcc-c++ openssl-devel patch wget lbzip2 pam-devel lzo-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
mkdir /usr/local/ssl/
# 编译安装
wget --no-check-certificate https://www.openssl.org/source/openssl-3.0.2.tar.gz
tar xf openssl-3.0.2.tar.gz
cd openssl-3.0.2/
./config --prefix=/usr/local/ssl/
make -j 8
make install
# 备份openssl
mv /usr/bin/openssl /usr/bin/openssl_bak`date '+%Y-%m-%-d_%H:%M:%S'`
mv /usr/include/openssl /usr/include/openssl_bak`date '+%Y-%m-%-d_%H:%M:%S'`
# 创建软连接
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
# 加载新配置
echo "/usr/local/ssl/lib64" >> /etc/ld.so.conf
/sbin/ldconfig
# 查看当前openssl 版本
openssl version -a