OpenSSL 1.1.1q and Qt 5.15.10
-
Hello,
I'm using a QNetworkAccessManager instance to send a POST request. The finished signal of the network access manager is emitted and the corresponding slot gets called.
However, when I call the error() method of the QNetworkReply in the slot connected to the finished signal of the network manager, I'm getting a QNetworkReply::SslHandshakeFailedError.Both sslErrors signals of the network access manager and the reply that was created using m_networkAccessManager.post are connecting to their corresponding slots, but none of these slots was called, despite the Qt documentation:
"QNetworkReply::SslHandshakeFailedError|6|the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted."
Does the fact that no slot was called mean that the sslErrors was not emitted? If yes, in what case is it supposed to happen?
What would you suggest to fix it?
I'm using Qt 5.15.10 and Open SSL 1.1.1q (also tested with Open SSL 1.1.1d, and OpenSSL 1.1.1j)
-
I found this post: https://forum.qt.io/topic/137558/qt5-openssl-msvc2019-cmake-can-t-get-it-to-work/5
But even my copying msvcr100.dll to the binary folder, I'm still getting the SSL handshake error message. -
Setting the protocol in the SSL configuration of the request fixed it.
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setProtocol(QSsl::TlsV1_2);
...
QNetworkRequest test(QUrl("some/address"));
testRequest.setSslConfiguration(config);Thank you!
