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. TLS initialization failed during API call?
Qt 6.11 is out! See what's new in the release blog

TLS initialization failed during API call?

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 4 Posters 7.0k 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.
  • C Offline
    C Offline
    ckzaner
    wrote on last edited by
    #5

    Apologies I thought 4.8 was the version, that's just what it shows when I open it. I installed 5.12.0.

    I recently downloaded openssl-1.0,2a-win32-mingw so I have OpenSSL downloaded.

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

      No, that's the Qt Creator version which is unrelated to the Qt version you are using to build your application.

      IIRC, Qt 5,12 is using OpenSSL 1.1. The OpenSSL 1.1 series is not backward compatible with the OpenSSL 1.0 series.

      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
      1
      • C Offline
        C Offline
        ckzaner
        wrote on last edited by
        #7

        Ok so Qt 5.12.
        Currently I have no OpenSSL from before 1.1 attached to the project though. I have 1.0.2 in my downloads but it currently is not associated with Qt or the project. Knowing this and seeing the code, any idea how to fix the error?

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

          Download OpenSSL 1.1 and then in the Run part of the Project panel, modify the PATH environnement variable and add the folder where the OpenSSL .dll files can be found.

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

          C 1 Reply Last reply
          0
          • SGaistS SGaist

            Download OpenSSL 1.1 and then in the Run part of the Project panel, modify the PATH environnement variable and add the folder where the OpenSSL .dll files can be found.

            C Offline
            C Offline
            ckzaner
            wrote on last edited by
            #9

            @SGaist My I ask how to actually do that? I have the file in C:/OpenSSL-Win64 but I'm not sure where to exactly add it or insert it? I don't see an explicit PATH environment variable that this could be added to, or at least if I do see it I'm unsure if it is it.

            jsulmJ 1 Reply Last reply
            0
            • C ckzaner

              @SGaist My I ask how to actually do that? I have the file in C:/OpenSSL-Win64 but I'm not sure where to exactly add it or insert it? I don't see an explicit PATH environment variable that this could be added to, or at least if I do see it I'm unsure if it is it.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #10

              @ckzaner Did you check the Run settings as @SGaist suggested?
              I'm pretty sure you have PATH variable under "Run Environment" there.
              So, click on "Projects" at the left side in QtCreator and select "Run" in the Kit you're using and then expand "Run Environment".
              You need to add the path containing OpenSSL libraries to PATH there.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              C 1 Reply Last reply
              0
              • C Offline
                C Offline
                ckzaner
                wrote on last edited by ckzaner
                #11

                Ok so I went from Projects--->Run (on left side underneath Build)
                There is not anything explicitly called the PATH environment or anything like that.
                There is the section under Run which shows me the Run Configuration which shows my current directory for the project.
                Would I select "add" here and then give the directions to the OpenSSL-Win64 file?

                Edit::: @jsulm Actually at the bottom there is a Run Environment section. I'll see if I do this right.
                I'm assuming select add, name it opensslv1.1, then give path to the libs folder and that's it?

                1 Reply Last reply
                0
                • jsulmJ jsulm

                  @ckzaner Did you check the Run settings as @SGaist suggested?
                  I'm pretty sure you have PATH variable under "Run Environment" there.
                  So, click on "Projects" at the left side in QtCreator and select "Run" in the Kit you're using and then expand "Run Environment".
                  You need to add the path containing OpenSSL libraries to PATH there.

                  C Offline
                  C Offline
                  ckzaner
                  wrote on last edited by ckzaner
                  #12

                  @jsulm So I have this in the Run Environment now.
                  0_1545118944140_openssl.PNG
                  I assume there's more to be done?
                  I still get the same error "qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed"

                  jsulmJ 1 Reply Last reply
                  0
                  • C ckzaner

                    @jsulm So I have this in the Run Environment now.
                    0_1545118944140_openssl.PNG
                    I assume there's more to be done?
                    I still get the same error "qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed"

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #13

                    @ckzaner You need to change PATH variable there as @SGaist suggested...

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    C 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @ckzaner You need to change PATH variable there as @SGaist suggested...

                      C Offline
                      C Offline
                      ckzaner
                      wrote on last edited by
                      #14

                      @jsulm I found "Path". Maybe I need to change something else?
                      This is the value now:
                      C:\Qt\Tools\mingw730_64\bin;C:\Qt\5.12.0\mingw73_64\bin;C:\Qt\Tools\mingw730_64\bin;C:\OpenSSL-Win64\bin;C:\Windows\system32;......(so on so forth).

                      The bin has all the .dll folders. Not sure if Qt is using them though. I used the line:
                      qDebug() <<"ssl:" << QSslSocket::sslLibraryBuildVersionString();
                      to try and see if Qt was using it but it says OpenSSL 1.0.2p

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

                        Ok, then in that case, point it to the OpenSSL 1.0 you installed on your machine.

                        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
                        1
                        • Y Offline
                          Y Offline
                          Yash001
                          wrote on last edited by Yash001
                          #16
                          This post is deleted!
                          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