1. Identify the Source of the Problem
Check if the OpenSSL binary is using outdated libraries.
ldd $(which openssl)
Look for lines referencing:
/usr/local/lib/libssl.so.1.1 /usr/local/lib/libcrypto.so.1.1
These indicate that the OpenSSL binary is linking against outdated libraries from /usr/local/lib
.
2. Switch to the System’s OpenSSL Binary
The goal here is to disable the custom OpenSSL binary (if it exists) so the system uses the default one.
sudo mv /usr/local/bin/openssl /usr/local/bin/openssl.bak
This renames the custom OpenSSL binary to a backup name. Now, running openssl
will refer to the system's version typically located at /usr/bin/openssl
.
Verify it:
which openssl
You should see:
/usr/bin/openssl
3. Remove Old Symlinks from /usr/local/lib
The custom or outdated libraries in /usr/local/lib
often take precedence over system libraries due to path ordering.
Check for old symlinks:
ls -l /usr/local/lib | grep -E 'libssl|libcrypto'
Remove them safely:
sudo rm /usr/local/lib/libssl.so.1.1 sudo rm /usr/local/lib/libcrypto.so.1.1
Be sure they are symlinks pointing to the wrong versions before deleting.
4. Update the Dynamic Linker Cache
This ensures that your system recognizes the correct, current library paths.
sudo ldconfig
You can double-check that /usr/local/lib
no longer has influence by running:
ldconfig -v 2>/dev/null | grep libssl ldconfig -v 2>/dev/null | grep libcrypto
5. Confirm the Fix
Ensure openssl
is now using the system libraries (e.g., libssl.so.3
, libcrypto.so.3
).
ldd $(which openssl)
You should now see something like:
libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3
Also confirm the OpenSSL version:
openssl version
Expected output:
OpenSSL 3.x.x <date>
Summary
Step | Action | Command |
---|---|---|
1 | Identify library conflict | ldd $(which openssl) |
2 | Backup custom OpenSSL | sudo mv /usr/local/bin/openssl /usr/local/bin/openssl.bak |
3 | Remove old symlinks | sudo rm /usr/local/lib/libssl.so.1.1 and libcrypto.so.1.1 |
4 | Update linker cache | sudo ldconfig |
5 | Confirm fix | ldd $(which openssl) and openssl version |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article