QSslSocket failure from Online Installer version (Ubuntu)
-
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
-
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.
Hi,
Which version of Qt are you using ?
-
Seeing the version of Ubuntu you are using, if you want to stay with Qt 5, then you should use the one from the distribution since it follows pretty closely the latest releases done after 5.15.2.
-
Seeing the version of Ubuntu you are using, if you want to stay with Qt 5, then you should use the one from the distribution since it follows pretty closely the latest releases done after 5.15.2.
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
-
-
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...
-