QSslSocket failure from Online Installer version (Ubuntu)
Solved
Installation and Deployment
-
Now Ubuntu using libssl 3.0 by default. I think Qt builded with lower versions.
So if I try to use QSslSocket, I see this fails in console log:
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate SSL error: "The peer did not present any certificate" Socket error: QAbstractSocket::SocketError(13)
How I can fix this with minimal pain?
Thanks.
-
Solved by manual linking with openssl1 and ssl1.
- Download old openssl sources:
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
- Compile:
tar -xf openssl-1.1.1q.tar.gz cd openssl-1.1.1q ./config make
- Add to project:
# .pro file: LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
-
Qt 6.x.x displays similar errors. So, Qt version is not important in this case. Qt6 reports seems more friendly:
qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x) qt.network.ssl: The backend "cert-only" does not support QSslKey qt.network.ssl: Active TLS backend does not support key creation qt.network.ssl: The backend "cert-only" does not support QSslSocket qt.network.ssl: The backend named "cert-only" does not support TLS qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
I didn't understand your advice a bit above.
-
-
Solved by manual linking with openssl1 and ssl1.
- Download old openssl sources:
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
- Compile:
tar -xf openssl-1.1.1q.tar.gz cd openssl-1.1.1q ./config make
- Add to project:
# .pro file: LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
-
-
@acetone said in QSslSocket failure from Online Installer version (Ubuntu):
Solved by manual linking with openssl1 and ssl1.
- Download old openssl sources:
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
- Compile:
tar -xf openssl-1.1.1q.tar.gz cd openssl-1.1.1q ./config make
- Add to project:
# .pro file: LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
This fixed the issue for me on Ubuntu 22.04 / Qt 5.15 but only when starting my program from Qt Creator, running it from the console shows the same ssl error...
-