OpenSSL安装升级

官网https://www.openssl.org/source/

当前(2020-10-22)最新稳定版本:https://www.openssl.org/source/openssl-1.1.1h.tar.gz

Note: The latest stable version is the 1.1.1 series. This is also our Long Term Support (LTS) version, supported until 11th September 2023. All older versions (including 1.1.0, 1.0.2, 1.0.0 and 0.9.8) are now out of support and should not be used. Users of these older versions are encourage to upgrade to 1.1.1 as soon as possible. Extended support for 1.0.2 to gain access to security fixes for that version is available.

下载解压包

wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz

tar zxvf openssl-1.1.1h.tar.gz

安装参考openssl-1.1.1h目录中的INSTALL文件

 

OpenSSL安装升级

主要安装命令四个:

OpenSSL安装升级

 

默认安装路径:

OpenSSL安装升级

修改默认路径安装时添加参数:

$ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl

 

详细安装步骤:

查看版本(是否已安装)

openssl version -a

1.自动/手动 配置OpenSSL

 

 

OpenSSL安装升级

 

OpenSSL安装升级

 

OpenSSL安装升级

2.编译OpenSSL文件

 

OpenSSL安装升级

构建失败解决措施:

 

OpenSSL安装升级

3、编译成功后,测试库文件

 

OpenSSL安装升级

4、测试成功,安装OpenSSL

 

OpenSSL安装升级

 

实操,以我百度云一台CentOS7服务器为例:

自带老版本:

OpenSSL安装升级

下载好最新版本,解压:

OpenSSL安装升级

执行配置命令,生成Makefile文件:OpenSSL安装升级

OpenSSL安装升级

接下来,make & make install (略过测试了)

OpenSSL安装升级

报错,安装下gcc,yum install gcc

OpenSSL安装升级

make & make install 编译、安装~

 

接下来,需要替换新的openssl入口,以及指定新openssl库文件位置:

openssl

/usr/local/bin下

配置文件

/usr/local/ssl下

库文件

/usr/local/lib64下

1、将原有openssl备份

mv /usr/bin/openssl /usr/bin/openssl.bak

2、添加新openssl软连接

ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl

3、将新的库文件地址写入记录so库的配置文件

echo "/usr/local/lib64" >> /etc/ld.so.conf  

4、ldconfig -v

设置生效

搞定!

OpenSSL安装升级