OpenSSL
下载openssl安装包
wget https://www.openssl.org/source/openssl-3.0.1.tar.gz
执行后如果拉不下来,出现证书过期,需要加上 --no-check-certificate 不做检查
wget https://www.openssl.org/source/openssl-3.0.1.tar.gz --no-check-certificate
解压
·+ 、
1
安装过程中会出现Can’t locate IPC/Cmd.pm in 错误
Can't locate IPC/Cmd.pm in @INC (@INC contains: /root/Downloads/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 . /root/Downloads/openssl-3.0.1/external/perl/Text-Template-1.56/lib) at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
Compilation failed in require at /root/Downloads/openssl-3.0.1/Configure line 23.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/Configure line 23.
1
2
3
4
错误解决方案为参考报错解决方案
Linux安装openssl出现Can‘t locate IPC/Cmd.pm in 找不到perl
解决完这个问题之后重新配置就可以了
./config --prefix=/opt/common/openssl-3.0.1/openssl
1
编译安装
make
make install
1
2
测试
去到配置的指定目录下
cd /opt/common/openssl-3.0.1/openssl
./openssl -version
1
2
如果出现下面的错误 不需要管
创建软链接
ln -s /opt/common/openssl-3.0.1/openssl /usr/bin/openssl
1
然后继续测试
./openssl -version
1
出现了这个错
error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
1
使用ldd查看缺少那些库
ldd /opt/common/openssl-3.0.1/openssl
1
原因是动态路径找不到,加入动态库的路径
echo /opt/common/openssl-3.0.1/openssl/lib64 >> /etc/ld.so.conf
ldconfig /etc/ld.so.conf #刷新动态路径
1
2
N次测试
./openssl -version
1
安装成功
装的挺麻烦的,浪费好几个小时,真是不容易。
————————————————
版权声明:本文为CSDN博主「无奈的码农」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_27566167/article/details/128594728