Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenSSL 1.1.1q and Qt 5.15.10
Forum Updated to NodeBB v4.3 + New Features

OpenSSL 1.1.1q and Qt 5.15.10

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 562 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mistralegnaM Offline
    mistralegnaM Offline
    mistralegna
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0
    • mistralegnaM Offline
      mistralegnaM Offline
      mistralegna
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #3

        Hi, if you build the example app in Qt,securesocketclient:
        Screenshot 2022-08-09 at 15.07.15.png
        What happens when you click on the button "Connect to host"?

        1 Reply Last reply
        0
        • mistralegnaM Offline
          mistralegnaM Offline
          mistralegna
          wrote on last edited by
          #4

          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!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved