error while loading shared libraries: libssl.so.1.1 (and libcrypto.so.1.1)
Solved.
Problem is that if you install non-Ubuntu version of openssl (unpatched) you get the "error while loading shared libraries" error, because this is something that was added by Ubuntu devs to their distribution (and I still don't know why and makes no sense and makes lots of trouble). Source: https://askubuntu.com/a/830532/676863
So, mostly you will run into this if you compiled an official version from https://www.openssl.org/source/ e.g. the openssl-1.0.2m.tar.gz version. While official Ubuntu patched (million times according to the guys at #ubuntu on Freenode) version is still openssl-1.0.2g and is the one you want to patch, compile and install to make it working.
Solution (edited from https://stackoverflow.com/a/22634441/3108268):
- I used this build https://launchpad.net/ubuntu/+source/openssl/1.0.2g-1ubuntu13 because it was most up-to-date.
-
wget https://launchpad.net/ubuntu/+archive/primary/+files/openssl_1.0.2g.orig.tar.gz
(might need to add--no-check-certificate
) tar -xvf openssl_1.0.2g.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/openssl_1.0.2g-1ubuntu13.debian.tar.xz
-
tar -xvf openssl_1.0.2g-1ubuntu13.debian.tar.xz
andmv debian openssl_1.0.2g-1ubuntu13
-
whereis openssl
locate current openssl and delete/remove/backup it. -
cd openssl_1.0.2g/
andpatch -p1 < ../openssl_1.0.2g-1ubuntu13/patches/version-script.patch
-
make clean
and./config shared --prefix=/usr/local --openssldir=/usr/local/ssl -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
(or maybe you just need plain.config
, doesn't work for me) -
make
andmake test
andmake install
openssl version
I also needed to reboot
to be able to connect back in via SSH. All these commands were executed via web console on a cloud server. Downloaded file directory names might be different, I didn't check, so do ls -l
.