Linux 升级 OpenSSL 版本

文章
林里克斯

OpenSSL 是一个开放源代码的软件库包,应用程序可以使用这个包来进行安全通信,避免窃听,同时确认另一端连接者的身份。

实验平台:CentOS 7.7.1908

OpenSSL version:1.1.1h


1.查看现有版本

$ openssl  version
OpenSSL 1.0.2k-fips  26 Jan 2017

2.官网下载最新包

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

3.编译安装

$ tar xf openssl-1.1.1h.tar.gz
$ cd openssl-1.1.1h
$ ./config --prefix=/usr/local/openssl shared zlib

Operating system: aarch64-whatever-linux2
Configuring OpenSSL version 1.1.1h (0x1010108fL) for linux-aarch64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************

$ make && make install 

4.备份老版本软连新版本

$ mv /usr/include/openssl/ /usr/include/openssbak
$ ln -s /usr/local/openssl/include/openssl /usr/include/openssl

$ cp -rp /usr/bin/openssl /usr/bin/opensslbak
$ ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

5.验证

$ openssl version
./openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
#报错缺少 libssl.so.1.1 动态库

6.查看现有动态库

ldconfig -v

7.解决报错缺少 libssl.so.1.1 动态库

$ cp -rp /usr/local/openssl/lib/libssl.so.1.1 /usr/lib/
$ cp -rp /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/

8.再次验证

$ openssl version
openssl: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
#报错缺少 libcrypto.so.1.1 动态库

9.解决报错缺少 libcrypto.so.1.1 动态库

$ cp -rp /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/

10.验证查看版本

$ openssl version
OpenSSL 1.1.1h  22 Sep 2020

11.更新动态链接库数据:

$ echo "/usr/local/ssl/lib" >> /etc/ld.so.conf

Over~

版权协议须知!

本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意

1013 0 2020-09-29


分享:
icon_mrgreen.gificon_neutral.gificon_twisted.gificon_arrow.gificon_eek.gificon_smile.gificon_confused.gificon_cool.gificon_evil.gificon_biggrin.gificon_idea.gificon_redface.gificon_razz.gificon_rolleyes.gificon_wink.gificon_cry.gificon_surprised.gificon_lol.gificon_mad.gificon_sad.gificon_exclaim.gificon_question.gif
博主卡片
林里克斯 博主大人
一个致力于Linux的运维平台
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。

现在时间 2024-03-28

今日天气
站点统计
  • 文章总数:240篇
  • 分类总数:29个
  • 评论总数:10条
  • 本站总访问量 208447 次

@奥奥

@Wong arrhenius 牛比

@MakerFace 厉害了!