OpenSSL安装升级「终于解决」

(6) 2023-03-26 14:35

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说OpenSSL安装升级「终于解决」,希望能够帮助你!!!。
OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第1张

官网:/source/index.html

当前(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

 详细安装步骤(以我百度云一台CentOS7服务器为例):

查看版本(是否已安装)

openssl version -a

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第2张

下载好最新版本,解压:

tar zxvf openssl-1.1.1h.tar.gz

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第3张

执行配置命令,生成Makefile文件:

cd openssl-1.1.1h
./config

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第4张

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第5张

make & make install 

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第6张

报错,安装下gcc

yum install gcc

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第7张

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

mv /usr/include/openssl /usr/include/openssl.bak 

2、添加新openssl软连接

ln -s /usr/local/bin/openssl /usr/bin/openssl

ln -s /usr/local/include/openssl/ /usr/include/openssl

#可以用which openssl命令查看路径,如果有神通数据库则路径如下:/opt/ShenTong/bin/openssl

ln -s /usr/bin/openssl /opt/ShenTong/bin/openssl
 

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

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

4、设置生效

ldconfig -v

搞定!

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第8张

PLUS - 主要安装命令四个:

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

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第9张

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第10张

1、自动 / 手动 配置OpenSSL

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

 #自动配置

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第11张

#手动配置

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第12张

#配置与源码文件目录分离

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第13张

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

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第14张

2.编译OpenSSL文件

 OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第15张

#构建失败解决措施:

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第16张

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

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第17张

4、测试成功,安装OpenSSL

OpenSSL安装升级「终于解决」_https://bianchenghao6.com/blog__第18张

上一篇

已是最后文章

下一篇

已是最新文章

发表回复