Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QSslSocket::startClientEncryption: TLS initialization failed
Forum Update on Monday, May 27th 2025

QSslSocket::startClientEncryption: TLS initialization failed

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 426 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.
  • K Offline
    K Offline
    KidBuu
    wrote on 26 Apr 2022, 20:17 last edited by
    #1

    I've made a deployable application that uses OpenSSL. I installed the OpenSSL 1.1.1j Toolkit using QT's Maintenance Tool, and copied the "libcrypto-1_1-x64.dll" and "libssl-1_1-x64.dll" into the win64 directory of the deployed application.

    It works perfectly fine on my computer and several other computers that I've tested with. However, I decided to test it on a freshly made Windows 10 x64 Virtual Machine. When starting the application and connecting I get the following errors:

    QSslSocket::startClientEncryption: TLS initialization failed
    QAbstractSocket::SocketError(20)
    

    Qt Version: 5.15.0
    OpenSSL Version: 1.1.1

    Does anyone know what's going on? The application is quite large, if sample code is needed I'll have to make a smaller sample project...

    1 Reply Last reply
    0
    • H Online
      H Online
      hskoglund
      wrote on 26 Apr 2022, 20:30 last edited by
      #2

      Hi, just a guess but maybe you've forgotten to install (or copy) the Microsoft C/C++ runtime .dlls (like vcruntime140.dll etc) they are needed by the OpenSSL .dlls I believe.

      K 1 Reply Last reply 26 Apr 2022, 22:38
      2
      • K Offline
        K Offline
        KidBuu
        wrote on 26 Apr 2022, 21:33 last edited by
        #3

        The deployed version has an installer that includes the required c++ redistributable. So it was installed also, and upon searching for that specific file it was found in C:\Windows\system32.

        1 Reply Last reply
        0
        • H hskoglund
          26 Apr 2022, 20:30

          Hi, just a guess but maybe you've forgotten to install (or copy) the Microsoft C/C++ runtime .dlls (like vcruntime140.dll etc) they are needed by the OpenSSL .dlls I believe.

          K Offline
          K Offline
          KidBuu
          wrote on 26 Apr 2022, 22:38 last edited by KidBuu
          #4

          @hskoglund Never mind, you were correct... mostly just wrong version of the MSVC.

          The "libcrypto-1_1-x64.dll" and "libssl-1_1-x64.dll" DLL files were built using Microsoft Visual Studio 2010 (I guess), and never updated (unfortunately). So it requires the Visual Studio 2010 Redistributable... Rather than just force users to install this on their PC's, I've included both MSVCR100.dll and MSVCP100.dll in the application folder.

          Thanks for the tip!

          1 Reply Last reply
          0

          1/4

          26 Apr 2022, 20:17

          • Login

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