查看openssl版本
openssl version
离线编译安装升级
#!/bin/shOPENSSLVER=3.1.4OPENSSL_V=`openssl version`echo "当前OpenSSL 版本 ${OPENSSL_V}"
#------------------------------------------------
#wget https://www.openssl.org/source/openssl-3.1.4.tar.gzecho "安装OpenSSL${OPENSSLVER}..."rm -rf /home/tuners/openssl
mkdir -p /home/tuners/opensslyum -y install gcc zlib perl
yum update gcc# cp -f ../soft/openssl/openssl-${OPENSSLVER}.tar.gz /home/tuners/openssl/
\cp -r ./* /home/tuners/openssl
cd /home/tuners/openssl
tar -xzf openssl-*.tar.gz
cd openssl-${OPENSSLVER}./config shared zlib --prefix=/usr/local/openssl
make
make install#在/etc/ld.so.conf文件的末尾添加/usr/local/openssl/lib
echo "/usr/local/openssl/lib64" >> /etc/ld.so.conf
ldconfig#添加OpenSSL的环境变量。在/etc/profile文件的末尾添加以下内容
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
echo "OPENSSL=/usr/local/openssl/bin" >> /etc/profile
echo "PATH=$OPENSSL:$PATH:$HOME/bin" >> /etc/profile
ldconfig
查看升级之后的版本
离线安装升级
脚本地址 https://gitcode.net/zengliguang/ky10_x86_openssl_install.git
执行离线安装脚本
openssl_offline_install.sh 即可完成安装
mkdir -p /home/tuners/openssl
\cp -r ./* /home/tuners/openssl
chmod 777 -R /home/tuners#在/etc/ld.so.conf文件的末尾添加/usr/local/openssl/lib
echo "/home/tuners/openssl/openssl_offline" >> /etc/ld.so.conf
ldconfig#添加OpenSSL的环境变量。在/etc/profile文件的末尾添加以下内容
export OPENSSL=/home/tuners/openssl/openssl_offline
export PATH=$OPENSSL:$PATH:$HOME/bin
echo "OPENSSL=/home/tuners/openssl/openssl_offline" >> /etc/profile
echo "PATH=$OPENSSL:$PATH:$HOME/bin" >> /etc/profile
ldconfig
openssl version