1、下载OpenSSL
wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
2、解压编译安装
tar xf openssl-1.1.0e.tar.gz
cd openssl-1.1.0e
./config shared zlib
make && make install
3、替换旧版本
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl/ /usr/include/openssl
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
4、错误解决
make[1]: *** [crypto/comp/c_zlib.o] Error 1
make[1]: Leaving directory `/opt/openssl-1.1.0e'
make: *** [all] Error 2
[root@XXXXX openssl-1.1.0e]# yum -y install zlib-devel