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
Forum Updated to NodeBB v4.3 + New Features

SSL error when downloading files with url

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 300 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.
  • B Offline
    B Offline
    Blackzero
    wrote on 12 Feb 2025, 04:19 last edited by Blackzero 2 Dec 2025, 04:23
    #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
    • H Online
      H Online
      hskoglund
      wrote on 12 Feb 2025, 05:01 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 12 Feb 2025, 05:05
      0
      • H hskoglund
        12 Feb 2025, 05:01

        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 12 Feb 2025, 05:05 last edited by
        #3

        @hskoglund QTCPSocket ? like it's not

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Feb 2025, 20:24 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 13 Feb 2025, 20:51
          0
          • S SGaist
            12 Feb 2025, 20:24

            Hi,

            Which version of OpenSSL are you using ?

            @hskoglund was referencing this example

            B Offline
            B Offline
            Blackzero
            wrote on 13 Feb 2025, 20:51 last edited by
            #5

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

            S 1 Reply Last reply 14 Feb 2025, 20:53
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on 13 Feb 2025, 22:37 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
                13 Feb 2025, 20:51

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

                S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 14 Feb 2025, 20:53 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 15 Feb 2025, 00:49
                1
                • S SGaist
                  14 Feb 2025, 20:53

                  @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 15 Feb 2025, 00:49 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
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 15 Feb 2025, 20:30 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

                    2/9

                    12 Feb 2025, 05:01

                    topic:navigator.unread, 7
                    • Login

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