c++openssldkimlibssllibcrypto

openssl .so library version incompatible


I wanted to upgrade the package OpenSSL to 1.1.1d from 1.0.0. However, there is another package OpenDKIM that depends on OpenSSL old version 1.0.0. So I made a symlink as below

ln -s libssl.so.1.1 libssl.so.1.0.0
ln -s libcrypto.so.1.1 libcrypto.so.1.0.0

And following is the result of ldd binary

libssl.so.1.1 => /usr/lib/zmta/libssl.so.1.1 (0x00007fb6a52b4000)
libcrypto.so.1.1 => /usr/lib/zmta/libcrypto.so.1.1 (0x00007fb6a4df3000)
libopendkim.so.10 => /usr/lib/libopendkim.so.10 (0x00007fb6a4bd7000)

The compilation was okay in build machine centos7. But, when I try to run the binary in Ubuntu-18.04, the following error occurred.

libcrypto.so.10: version `libcrypto.so.10' not found (libopendkim.so.10). No file or directory named libcrypto.so.10

So I created a symlink file libcrypto.so.10 pointing to libcrypto.so.1.1, but the following error occurred.

libcrypto.so.10: version `libcrypto.so.10' not found (libopendkim.so.10)

I could not get through this error. Any help is greatly appreciated.


Solution

  • OpenSSL package can be a dependency for multiple other dependency packages that you are using for your application.

    If you are trying to bundle the dependencies along with your application, then you will have to manually take care of the dependencies.

    If you are trying to upgrade OpenSSL, you will have to look if other dependencies like OpenDKIM supports the upgraded version of OpenSSL.

    If other dependencies(OpenDKIM) support the upgraded version of OpenSSL, you will have to recompile those dependencies(OpenDKIM) against the new version of OpenSSL.

    In the above case, just adding symlink libssl.so.1.1 that points to an older version library libssl.so.1.0.0 will not work.

    Note: While recompiling other dependencies(OpenDKIM) for your application, they are not compiled against an older version. Even when your OpenSSL is updated to the required new version, there are older libraries that still exist for compatibility.

    While compiling other dependencies, if they take the older version library and header files of OpenSSL in the system, then runtime issues in version mismatch will occur.