openssl升级或降级以及问题:openssl: error while loading shared libraries: .1.1:

时间:2025-01-23 07:51:14

openssl升级或降级

一、首先下载源码包

/source/old/

然后选择自己需要的版本

二、解压软件

tar -zxf openssl-1.0.(我这里是1.0.2k版本)

cd openssl-1.0.2k

三、然后安装到安装到/usr/local/openssl/目录下

cd openssl-1.0.2k

./config --prefix=/usr/local/ssl 或./config --prefix=/usr/local/ssl --shared

make && make install

四、备份旧的openssl,然后为新的openssl版本做软连接

mv /usr/bin/openssl /usr/bin/

mv /usr/include/openssl /usr/include/
mv /usr/lib64/openssl /usr/lib64/

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

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

echo “/usr/local/ssl/lib”>>/etc/

#添加so库的路径,添加完成之后,运行ldconfig ,将新增的so 文件缓存到/etc/中;

ldconfig -v

openssl version -a #确认版本是否为1.0.2d

回退:
mv /usr/bin/openssl /usr/bin/
mv /usr/bin/ /usr/bin/openssl
mv /usr/lib64/ /usr/lib64/openssl
ldconfig -v
openssl version查看版本

报错:
[root@localhost include]# openssl version
openssl: error while loading shared libraries: .1.1: cannot open shared object file: No such file or directory

解决;
ln -s /usr/local/ssl/lib/.1.1 /usr/lib64/.1.1
ln -s /usr/local/ssl/lib/.1.1 /usr/lib64/.1.1