[root@db ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@db ~]# uname -a
Linux db 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@db openssl-1.0.2m]# which openssl
/usr/bin/openssl
[root@db ~]# openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013

[root@db ~]# wget https://www.openssl.org/source/openssl-1.0.2m.tar.gz #LTS
[root@db ~]# tar zxvf openssl-1.0.2m.tar.gz
[root@db ~]# cd openssl-1.0.2m
[root@db ~]# ./config shared zlib-dynamic #编译成动态库,避免重新编译其他依赖打的应用
[root@db ~]# make -j 8
[root@db ~]# make install
[root@db ~]# /usr/local/ssl/bin/openssl version #查看编译后的版本
OpenSSL 1.0.2m 2 Nov 2017
[root@db ~]# mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
[root@db openssl-1.0.2m]# find / -name libssl.so
/usr/lib64/libssl.so
/usr/local/ssl/lib/libssl.so
/root/openssl-1.0.2m/libssl.so
[root@db ~]# ll -h /usr/lib64/libssl.so
[root@db ~]# ll -h /usr/local/ssl/lib/libssl.so
[root@db ~]# ll -h /root/openssl-1.0.2m/libssl.so
#修改系统自带的openssl库文件
mv /usr/lib64/libssl.so /usr/lib64/libssl.so.old
ln -s /usr/local/ssl/lib/libssl.so /usr/lib64/libssl.so


#查看openssl依赖库版本
[root@db openssl-1.0.2m]# strings /usr/lib64/libssl.so |grep OpenSSL
OpenSSLDie
SSLv3 part of OpenSSL 1.0.2m 2 Nov 2017
TLSv1 part of OpenSSL 1.0.2m 2 Nov 2017
DTLSv1 part of OpenSSL 1.0.2m 2 Nov 2017
OpenSSL 1.0.2m 2 Nov 2017
在/etc/ld.so.conf文件中写入openssl库文件的搜索路径
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
source /etc/ld.so.conf

[root@db openssl-1.0.2m]# ldconfig -v |grep libssl
libssl.so.1.0.0 -> libssl.so.1.0.0
libssl3.so -> libssl3.so
libssl.so.10 -> libssl.so.1.0.1e

[root@db openssl-1.0.2m]# openssl version
OpenSSL 1.0.2m 2 Nov 2017

1 对 “openssl升级”的想法;

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code