当前位置:网站首页>编译Openssl

编译Openssl

2022-04-23 14:10:00 小灰墩墩

编译Openssl

openssl-3.0.2.tar.gz

实验环境

# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

1、安装相关依赖包

# yum install gcc
# yum install perl-CPAN 
# yum install perl-YAML perl-Term-ReadLine perl-version perl-libs perl-devel perl-Test-* perl-Pod-* perl-ExtUtils-* perl-CGI

2、上传源码包

官方下载地址:http://www.openssl.org/

# cd /usr/local/src
# rz -b
# ls /usr/local/src/
openssl-3.0.2.tar.gz

3、解压

# pwd
/usr/local/src
# tar xvf openssl-3.0.2.tar.gz

4、编译&&安装

# pwd
/usr/local/src
# cd openssl-3.0.2/
# ./Configure --prefix=/opt/openssl 
# make && make install 

5、创建软连接

# ln -sv /opt/openssl/lib64/libssl.so.3 /lib64/libssl.so.3
# ln -sv /opt/openssl/lib64/libcrypto.so.3 /lib64/libcrypto.so.3

6、备份并重置新的openssl

# mv /usr/bin/openssl /usr/bin/openssl_old
# ln -sv /opt/openssl/bin/openssl /usr/bin/openssl

7、验证

# openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

版权声明
本文为[小灰墩墩]所创,转载请带上原文链接,感谢
https://blog.csdn.net/swyer_66/article/details/124209748