【openssl】 version `OPENSSL_3.0.3' not found 問題
使用openssl時候報錯:
openssl lib/libcrypto.so.3: version `OPENSSL_3.0.3' not found
查閱CSDN
發現有博主說把別的地方的libcrypto.so.3
復制過去就好了。
嘗試無效
警告!這個操作不對:
不要復制不要復制不要復制!!!!
接下來定位問題,定位到issue:
[lib64/libcrypto.so.3: version `OPENSSL_3.0.3' not found · Issue #19801 · openssl/openssl](https://github.com/openssl/openssl/issues/19801)
https://github.com/openssl/openssl/issues/19801
Do you have two OpenSSL installs? It appears that you have the Fedora OpenSSL libraries in /lib64 and a local install in /usr/local/lib64. _The linux loader won't pick up libraries from the current directory._You don't indicate which openssl is in use: `which openssl`. If you have `/usr/local/bin` before `/usr/bin` in your `${PATH}`, then you are picking up the local install binary, but it's finding the system installed libraries in `/lib64`. If you want to use the local installed libraries, you may need to update `ldconfig` and/or set the `LD_LIBRARY_PATH=/usr/local/lib64`.
e.g.LD_LIBRARY_PATH=/usr/local/lib64 /usr/local/bin/openssl helpvs./usr/bin/openssl help
這個問題一般是在自帶的openssl外又安裝了新版本的openssl引發的,系統不能很好區分兩個安裝的目錄依賴。需要進行環境變量的設置
linux下編輯~/.bashrc
文件
export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib64:$PATH"
如果報錯的文件夾是lib
那就把lib64
改成lib
即可
source ~/.bashrc
讓配置生效
bash
中輸入
openssl version
測試狀態,無報錯即成功