QSslSocket на Ubuntu 22.04 с OpenSSL v3.x.x не хочет работать

Рейтинг: 0Ответов: 1Опубликовано: 06.04.2023

Ubuntu 22.04. В репозиториях openssl 3.x.x. Насколько я понимаю, Qt Online Installer ставит дистрибутив, который зависит от openssl 1.1.1 (судя по тому, что в тул-ките инсталлера есть OpenSSL 1.1.1). Этот тул-кит я тоже себе поставил, но результата не дало.

Проблема в том, что QSslSocket зависит от OpenSSL и любые мои попытки его использовать сыпят в консоль

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

UPD. Qt6 выдает более отчетливые ошибки:

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 QSslKey
qt.network.ssl: Active TLS backend does not support key creation
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 QSslKey
qt.network.ssl: Active TLS backend does not support key creation
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 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

Как это можно исправить? OpenSSL 1.1.1 поддерживается до сентября 2023, хотелось бы подружить Qt с OpenSSL 3.x.x. Спасибо.

Ответы

▲ 0Принят

Ответ здесь: https://forum.qt.io/topic/144102/qsslsocket-failure-from-online-installer-version-ubuntu/2

Прилинковать openssl1 вручную.