Step-by-Step Guide to Resolve SSL Linking Issues on Linux Systems

Created by Bharadwaj daggumati, Modified on Mon, 21 Apr at 10:25 AM by Bharadwaj daggumati


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

StepActionCommand
1Identify library conflictldd $(which openssl)
2Backup custom OpenSSLsudo mv /usr/local/bin/openssl /usr/local/bin/openssl.bak
3Remove old symlinkssudo rm /usr/local/lib/libssl.so.1.1 and libcrypto.so.1.1
4Update linker cachesudo ldconfig
5Confirm fixldd $(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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article