Could not initialize OpenSSL library in Linux version

ralfmr's profile image ralfmr posted 4 weeks ago in General Permalink

I recently install the new Linux version 12.19. When I try to search for updates the dialog is empty and shows the message "Could not initialize OpenSSL library".

Do I have to configure the OpenSSL library somewhere?

ansgar's profile image ansgar posted 4 weeks ago Permalink

That libssl should be installed by the deb or rpm package, whichever you were using. If you instead unpacked a tgz release then it is probably missing.

Look at the deb control file in the "depends" section: https://github.com/HeidiSQL/HeidiSQL/blob/lazarus/deb-control.txt

Try sudo apt install libssl3

ralfmr's profile image ralfmr posted 4 weeks ago Permalink

My system uses Tuxedo OS which is an Ubuntu type.

When I try to install libssl3 I get the following message: Hinweis: »libssl3t64« wird an Stelle von »libssl3« gewählt. libssl3t64 ist schon die neueste Version (3.0.13-0ubuntu3.11).

There is a libssl3.so in /usr/lib/x86_64-linux-gnu. Should I create a symbolic link to that file? And if yes, where is it expected to be found?

ansgar's profile image ansgar posted 4 weeks ago Permalink

That path looks ok, if I read here.

And openssl version also gives you some 3.x version?

You can try to clear the lib cache: sudo ldconfig

Some reply from an AI:

FPC/Lazarus code (e.g. OpenSSL / fphttpclient wrappers) (like HeidiSQL) typically calls LoadLibrary/dlopen on names like libssl.so, libssl.so.1.1 or libssl.so.3 rather than hardcoding a full path. The actual resolution is delegated to the dynamic loader, which searches:

directories built into the loader (/lib, /usr/lib, /lib/<arch>-linux-gnu, /usr/lib/<arch>-linux-gnu)

plus anything configured via /etc/ld.so.conf.d/*.conf and ldconfig.

So from the app’s perspective, “where it looks” is simply “whatever the system dynamic linker knows about”.

ralfmr's profile image ralfmr posted 4 weeks ago Permalink

"openssl version" gives me this output:

OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)

Looks good to me. When I check /etc/ld.so.config.d/x86_64-linux-gnu.conf I find the directory /usr/lib/x86_64-linux-gnu where the lib is located.

I also tried "sudo ldconfig" with no effect.

ralfmr's profile image ralfmr posted 4 weeks ago Permalink

I investigated a little bit more on this issue.

I started heidisql with strace and searched for "libssl" in the resulting log (see attachment). It seems that several locations and versions of the library are tried without success, but in line 1434 it obviously finds the libssl.so.3 in the correct location.

What is the condition to display the message "Could not initialize OpenSSL library"? Is it that the lib is not found or is it something else?

1 attachment(s):
ralfmr's profile image ralfmr posted 4 weeks ago Permalink

When I start heidisql with

LD_DEBUG=libs HeidiSQL_GTK/heidisql 2>&1

I see that it finds libssl.so.3 and initializes the lib. But when I open the "Search for Updates" dialog it tries to find several other versions at many locations, but not libssl.so.3.

Maybe that's the reason. Could it be that the update dialog searches for another version of libssl?

ralfmr's profile image ralfmr posted 2 weeks ago Permalink

Solved the problem by adding the following symbolic links:

sudo ln -sf /usr/lib/x86_64-linux-gnu/libssl.so.3 /usr/lib/x86_64-linux-gnu/libssl.so.1.1

sudo ln -sf /usr/lib/x86_64-linux-gnu/libcrypto.so.3 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1

This "simulates" the old version that is searched by the update dialog. After that, the update dialog shows that my version is the current one :-)

ansgar's profile image ansgar posted 2 weeks ago Permalink

Thanks a lot for your helpful findings! I could not yet find the real cause behind the difference in the two places where SSL is used.

Please login to leave a reply, or register at first.