1、查看原版本
wget http://www.openssl.org/source/openssl-1.1.0c.tar.gz
openssl version
2、解压安装
tar zxf openssl-1.1.0c.tar.gz
cd openssl-1.1.0c
./config shared zlib
make
make install
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
echo “/usr/local/ssl/lib” >> /etc/ld.so.conf
ldconfig -v
(PS:
很多博客都这么写的
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
然而安装openssl-1.1.0c.tar.gz,ssl目录下并不存在bin和include文件夹,而是和ssl在同一级目录下!
)
3、查看版本
openssl version
可能错误:
1.make时
安装zlib-devel
2.openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
root用户执行:
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