操作系统安装完OpenSSL新版本后提示相关接口符号未找到

问题现象描述

例如执行rpm命令时出现如下报错:

1
rpm: relocation error: /lib64/librpmio.so.8: symbol EVP_md2 version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference

例如执行系统OpenSSL命令时出现如下报错:

1
/usr/bin/openssl: relocation error: /usr/bin/openssl: symbol EVP_md2 version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference

关键过程、根本原因分析

OpenSSL动态库路径设置在LD_LIBRARY_PATH或者OpenSSL动态库安装在/usr/local/lib下时——动态库搜索路径配置文件/etc/ld.so.conf中设定了/usr/local/lib,此时若系统工具或命令调用OpenSSL的动态库,会优先调用到系统原有库而非用户安装的库,导致冲突。

结论、解决方案及效果

推荐按安装OpenSSL/Tongsuo安装OpenSSL软件;请参见通过RPM包安装KAE通过DEB包安装KAE通过源码方式安装KAE安装KAE加速引擎软件包。

如果系统需要将/usr/local/lib路径设置在LD_LIBRARY_PATH环境变量或配置到/etc/ld.so.conf中,则需要通过指定安装路径与动态库路径安装OpenSSL源码。

1
2
3
./config --prefix=/usr/local/openssl -Wl,-rpath,/usr/local/openssl/lib
make
make install