Qt missing OpenSSL 3.x support on Ubuntu 22.04

I tried to build my application which uses QNetworkManager to communicate to a server. I did not have any problems on older Linux versions but with the newest Ubuntu 22.04 the network reply fails and QtCreator shows this output:

Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslSocket
The backend named "cert-only" does not support TLS
QSslSocket::connectToHostEncrypted: TLS initialization failed
QSslSocket::connectToHostEncrypted: TLS initialization failed

When I build my application on older Ubuntu (20.04) and deploy it as AppImage, and then run it on Ubuntu 22.04, the network communication fails too with the same error.

How can this be solved? I need to be able to create AppImage on older Ubuntu and then run it "everywhere"...

UPDATE: I managed to build and deploy deploy AppImage of my application on Ubuntu 20.04 with correct OpenSSL library and now it runs also on Ubuntu 22.04. The trick is to manually copy libssl.so.1.1 to the AppImage lib folder before calling linuxdeployqt on it.

But I still have not found how to build and run my application with QtCreator on Ubuntu 22.04. Fortunately this is not of high importance to me because I build it for deployment on Ubuntu 20.04.

Upvotes: 9

Views: 6870

Answers (2)

Benjamin T
Benjamin T

Reputation: 8321

Other answers work, but rather than manually installing or copying file around, I would suggest to use a .deb.

libssl1.1 package can be downloaded from https://packages.ubuntu.com/focal-updates/libssl1.1

Then you can simply install it with sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb.

In this way, it will appear in your installed package list and you will be able to cleanly remove it when you do not need it anymore.

Upvotes: 2

Mark
Mark

Reputation: 5152

I was able to solve this issue on Ubuntu 22.04 and Qt 6.3.0 following this workaround:

https://linuxpip.org/install-openssl-linux/

You have to build OpenSSL 1.1 from source code and tell the system to use the newly installed OpenSSL.

Upvotes: 0

Related Questions