环境说明

操作系统: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

  1. # 准备编译环境
  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
  3. mkdir /usr/local/ssl/
  4. # 编译安装
  5. wget --no-check-certificate https://www.openssl.org/source/openssl-3.0.2.tar.gz
  6. tar xf openssl-3.0.2.tar.gz
  7. cd openssl-3.0.2/
  8. ./config --prefix=/usr/local/ssl/
  9. make -j 8
  10. make install
  11. # 备份openssl
  12. mv /usr/bin/openssl /usr/bin/openssl_bak`date '+%Y-%m-%-d_%H:%M:%S'`
  13. mv /usr/include/openssl /usr/include/openssl_bak`date '+%Y-%m-%-d_%H:%M:%S'`
  14. # 创建软连接
  15. ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
  16. ln -s /usr/local/ssl/include/openssl /usr/include/openssl
  17. # 加载新配置
  18. echo "/usr/local/ssl/lib64" >> /etc/ld.so.conf
  19. /sbin/ldconfig
  20. # 查看当前openssl 版本
  21. openssl version -a