Centos7将openssl升级版本至 openssl-3.0.1

查看openssl当前版本号:

[root@syxk ~]# openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017

官方下载:https://www.openssl.org/source/

[root@syxk opt]#wget https://www.openssl.org/source/openssl-3.0.1.tar.gz

[root@syxk opt]#tar -xf openssl-3.0.1.tar.gz

[root@syxk opt]#cd openssl-3.0.1

[root@syxk openssl-3.0.1]#mkdir /usr/local/ssl

[root@syxk openssl-3.0.1]#./config --prefix=/usr/local/ssl/

Can't locate IPC/Cmd.pm in @INC (@INC contains: /opt/openssl-3.0.1/util/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /opt/openssl-3.0.1/external/perl/Text-Template-1.56/lib) at /opt/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.

BEGIN failed--compilation aborted at /opt/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.

Compilation failed in require at /opt/openssl-3.0.1/Configure line 23.

BEGIN failed--compilation aborted at /opt/openssl-3.0.1/Configure line 23.

解决办法:

安装所关联的软件包和编译工具包

[root@syxk openssl-3.0.1]#yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

[root@syxk openssl-3.0.1]#./config --prefix=/usr/local/ssl/

[root@syxk openssl-3.0.1]#make -j 4

[root@syxk openssl-3.0.1]#make install

[root@syxk openssl-3.0.1]#mv /usr/bin/openssl /usr/bin/openssl.old

[root@syxk openssl-3.0.1]#mv /usr/include/openssl/ /usr/include/openssl.old

[root@syxk openssl-3.0.1]#ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

[root@syxk openssl-3.0.1]#ln -s /usr/local/ssl/include/openssl /usr/include/openssl

[root@syxk openssl-3.0.1]#echo "/usr/local/ssl/lib64/" >> /etc/ld.so.conf

[root@syxk openssl-3.0.1]#ldconfig

[root@syxk openssl-3.0.1]#openssl version

OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)

[root@syxk openssl-3.0.1]#openssl version -a

OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)

built on: Fri Feb 25 06:51:37 2022 UTC

platform: linux-x86_64

options: bn(64,64)

compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG

OPENSSLDIR: "/usr/local/ssl/ssl"

ENGINESDIR: "/usr/local/ssl//lib64/engines-3"

MODULESDIR: "/usr/local/ssl//lib64/ossl-modules"

Seeding source: os-specific

CPUINFO: OPENSSL_ia32cap=0xffba22035f8bffff:0x283

posted @ 2022-02-25 16:27  岁月星空  阅读(2694)  评论(0编辑  收藏  举报