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. SSL error when downloading files with url
QtWS25 Last Chance

SSL error when downloading files with url

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 283 Views
  • 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.
  • B Offline
    B Offline
    Blackzero
    wrote on last edited by Blackzero
    #1

    I'm creating code to download files via http/https url but it's always OpenSSL error I don't know how to solve it, this is the source code I'm using https://wiki.qt.io/Download_Data_from_URL .

    error

    qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
    qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
    

    I am using the final QT 5 version (5.15.2)

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

      If you try the Secure Socket Client Example (one of the example apps in Qt 5.15.2), you get the same error?

      B 1 Reply Last reply
      0
      • hskoglundH hskoglund

        If you try the Secure Socket Client Example (one of the example apps in Qt 5.15.2), you get the same error?

        B Offline
        B Offline
        Blackzero
        wrote on last edited by
        #3

        @hskoglund QTCPSocket ? like it's not

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Which version of OpenSSL are you using ?

          @hskoglund was referencing this example

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Which version of OpenSSL are you using ?

            @hskoglund was referencing this example

            B Offline
            B Offline
            Blackzero
            wrote on last edited by
            #5

            @SGaist I installed it from the Maintenance Tool. it looks like OpenSSL V3.

            SGaistS 1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              Things that can be wrong:

              • OpenSSL not found or not loadable.
              • Server is presenting an invalid, expired, revoked, or self-signed certificate.
              • Server is presenting a valid certificate for which the client does not have the certificate trust chain.
              • OpenSSL version does not support matching protocol/ciphers to the server. Fo example, the server is forcing TLS 1.3 and your client side does not do TLS 1.3.

              The QNetworkAccessManager::sslErrors() signal could be your friend.

              1 Reply Last reply
              2
              • B Blackzero

                @SGaist I installed it from the Maintenance Tool. it looks like OpenSSL V3.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Blackzero said in SSL error when downloading files with url:

                @SGaist I installed it from the Maintenance Tool. it looks like OpenSSL V3.

                Qt 5.15.2 does not support OpenSSL 3.
                You have to build the latest Qt 5.15 yourself if you want to use that version.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                B 1 Reply Last reply
                1
                • SGaistS SGaist

                  @Blackzero said in SSL error when downloading files with url:

                  @SGaist I installed it from the Maintenance Tool. it looks like OpenSSL V3.

                  Qt 5.15.2 does not support OpenSSL 3.
                  You have to build the latest Qt 5.15 yourself if you want to use that version.

                  B Offline
                  B Offline
                  Blackzero
                  wrote on last edited by
                  #8

                  @SGaist I have replaced the DLL file in the OpenSSLV3 folder with OpenSSL V1.1.1 but it's the same.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Did you check that the dlls are found and loaded by your application ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    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