Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt6.2.1 TLS initialization failed when deploy on Win



  • Hi there)
    I have a small problem with OpenSSL
    App successfully connect to server through https but after build and moving exe into another folder I got
    TLS initialization failed error
    add from libssl-1_1-x64.dll, libcrypto-1_1-x64.dll, vccorlib140.dll , vcruntime140.dll, msvcp140.dll msvcr120_clr0400.dll
    OpenSSL 1.1.1d
    thanks for any help

    P.S. win 10, OpenSSL 1.1.1d, Qt 6.2.1, Qt Creator 5.0.3 base on Qt 5.15.2 (MSVS 2019, 64 bit)



  • @Galbarad said in Qt6.2.1 TLS initialization failed when deploy on Win:

    libssl-1_1-x64.dll, libcrypto-1_1-x64.dll, vccorlib140.dll , vcruntime140.dll, msvcp140.dll msvcr120_clr0400.dll

    Did you move those files too together with .exe? They are required.



  • yep, all files copy into same folder with .exe file
    also I try copy only libcrypto-1_1-x64.dll and libssl-1_1-x64.dll from
    C:\Qt\Tools\OpenSSL\Win_x64\bin
    it's version 1.1.1j but with the same result(
    app start correct but when try open page by https got TLS initialization error



  • @Galbarad for SSL from Qt you also need vc libraries that come with them, as those are build with MSVC.
    Version d is a bit dated, if I recall correctly version j should be used with Qt.

    Assuming the libraries are loaded properly (you can examine that using Dependency Walker tool) you should connect to the error signal and examine the values of SSL error.
    https://doc.qt.io/qt-6/qnetworkaccessmanager.html#sslErrors



  • hm
    QSslSocket::sslLibraryBuildVersionString();
    show for app that run from Qt Creator
    OpenSLL version "OpenSSL 1.1.1k 25 Mar 2021"
    but I found on my pc only
    1.1.1j
    1.1.1d
    1.1.1c

    try to install 1.1.1l and copy dll into exe folder

    nope, same problem(



  • QSslSocket::sslLibraryBuildVersionString() "OpenSSL 1.1.1k  25 Mar 2021" QSslSocket::sslLibraryVersionString() "OpenSSL 1.1.1l  24 Aug 2021"
    

    found topic with the same problem
    https://forum.qt.io/topic/86420/how-to-properly-include-openssl-for-a-windows-deployment-when-using-mingw/17



  • add log
    and got empty openssl ver from standalone exe

    QSslSocket::sslLibraryBuildVersionString()  QSslSocket::sslLibraryVersionString() 
    

    but under Qt Creator all work fine
    use Listdlls64.exe to get ddl list and saw that app running under qt creator use

    Path
    C:\Project\Qt\build-WD-Desktop_Qt_6_2_1_MSVC2019_64bit-Debug\debug\WD.exe
    C:\WINDOWS\SYSTEM32\ntdll.dll
    C:\WINDOWS\System32\KERNEL32.DLL
    C:\WINDOWS\System32\KERNELBASE.dll
    C:\WINDOWS\System32\SHELL32.dll
    C:\WINDOWS\System32\msvcp_win.dll
    C:\WINDOWS\System32\ucrtbase.dll
    C:\WINDOWS\System32\USER32.dll
    C:\WINDOWS\System32\win32u.dll
    C:\WINDOWS\System32\GDI32.dll
    C:\WINDOWS\System32\gdi32full.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Networkd.dll
    C:\WINDOWS\System32\ADVAPI32.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Cored.dll
    C:\WINDOWS\System32\msvcrt.dll
    C:\WINDOWS\System32\sechost.dll
    C:\WINDOWS\System32\RPCRT4.dll
    C:\WINDOWS\System32\WS2_32.dll
    C:\WINDOWS\System32\ole32.dll
    C:\WINDOWS\System32\combase.dll
    C:\WINDOWS\System32\OLEAUT32.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Qmld.dll
    C:\WINDOWS\SYSTEM32\VCRUNTIME140D.dll
    C:\WINDOWS\SYSTEM32\MSVCP140D.dll
    C:\WINDOWS\SYSTEM32\VCRUNTIME140_1D.dll
    C:\WINDOWS\SYSTEM32\ucrtbased.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Guid.dll
    C:\WINDOWS\SYSTEM32\DNSAPI.dll
    C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
    C:\WINDOWS\SYSTEM32\MPR.dll
    C:\WINDOWS\SYSTEM32\USERENV.dll
    C:\WINDOWS\SYSTEM32\NETAPI32.dll
    C:\WINDOWS\SYSTEM32\VERSION.dll
    C:\WINDOWS\SYSTEM32\WINMM.dll
    C:\WINDOWS\SYSTEM32\MSVCP140_1D.dll
    C:\WINDOWS\SYSTEM32\dxgi.dll
    C:\WINDOWS\SYSTEM32\d3d11.dll
    C:\WINDOWS\SYSTEM32\MSVCP140_2D.dll
    C:\WINDOWS\SYSTEM32\CRYPTBASE.DLL
    C:\WINDOWS\SYSTEM32\NETUTILS.DLL
    C:\WINDOWS\SYSTEM32\SRVCLI.DLL
    C:\WINDOWS\System32\IMM32.DLL
    C:\WINDOWS\System32\NSI.dll
    C:\WINDOWS\System32\bcryptPrimitives.dll
    C:\WINDOWS\System32\shcore.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\tls\qcertonlybackendd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\tls\qopensslbackendd.dll
    C:\WINDOWS\System32\CRYPT32.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\tls\qschannelbackendd.dll
    C:\WINDOWS\System32\bcrypt.dll
    C:\WINDOWS\SYSTEM32\Secur32.dll
    C:\WINDOWS\SYSTEM32\SSPICLI.DLL
    C:\WINDOWS\system32\libssl-1_1-x64.dll
    C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
    C:\WINDOWS\SYSTEM32\libcrypto-1_1-x64.dll
    C:\WINDOWS\SYSTEM32\CRYPTSP.dll
    C:\WINDOWS\system32\rsaenh.dll
    C:\WINDOWS\SYSTEM32\windows.storage.dll
    C:\WINDOWS\SYSTEM32\Wldp.dll
    C:\WINDOWS\System32\shlwapi.dll
    C:\WINDOWS\SYSTEM32\profapi.dll
    C:\WINDOWS\SYSTEM32\MSASN1.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\platforms\qwindowsd.dll
    C:\WINDOWS\SYSTEM32\dwmapi.dll
    C:\WINDOWS\SYSTEM32\WTSAPI32.dll
    C:\WINDOWS\SYSTEM32\kernel.appcore.dll
    C:\WINDOWS\system32\uxtheme.dll
    C:\WINDOWS\SYSTEM32\powrprof.dll
    C:\WINDOWS\SYSTEM32\UMPDC.dll
    C:\WINDOWS\System32\clbcatq.dll
    C:\Windows\System32\Windows.Globalization.dll
    C:\Windows\System32\Bcp47Langs.dll
    C:\Windows\System32\bcp47mrm.dll
    C:\WINDOWS\System32\CFGMGR32.dll
    C:\WINDOWS\system32\propsys.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\qtquick2plugind.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Quickd.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6OpenGLd.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QmlModelsd.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQml\WorkerScript\workerscriptplugind.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QmlWorkerScriptd.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\qtquickcontrols2plugind.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QuickControls2d.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QuickTemplates2d.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\Windows\qtquickcontrols2windowsstyleplugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\Fusion\qtquickcontrols2fusionstyleplugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\Basic\qtquickcontrols2basicstyleplugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\impl\qtquickcontrols2implplugind.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QuickControls2Impld.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Layouts\qquicklayoutsplugind.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6QuickLayoutsd.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Templates\qtquicktemplates2plugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Controls\Fusion\impl\qtquickcontrols2fusionstyleimplplugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\NativeStyle\qtquickcontrols2nativestyleplugind.dll
    C:\Qt\6.2.1\msvc2019_64\qml\QtQuick\Window\quickwindowplugind.dll
    C:\WINDOWS\system32\dwrite.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qgifd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qicnsd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qicod.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qjpegd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qsvgd.dll
    C:\Qt\6.2.1\msvc2019_64\bin\Qt6Svgd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qtgad.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qtiffd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qwbmpd.dll
    C:\Qt\6.2.1\msvc2019_64\plugins\imageformats\qwebpd.dll
    C:\WINDOWS\system32\d3d9.dll
    C:\WINDOWS\System32\MSCTF.dll
    C:\WINDOWS\system32\dataexchange.dll
    C:\WINDOWS\system32\dcomp.dll
    C:\WINDOWS\system32\twinapi.appcore.dll
    C:\WINDOWS\SYSTEM32\textinputframework.dll
    C:\WINDOWS\System32\CoreUIComponents.dll
    C:\WINDOWS\System32\CoreMessaging.dll
    C:\WINDOWS\SYSTEM32\ntmarta.dll
    C:\WINDOWS\SYSTEM32\wintypes.dll
    C:\WINDOWS\System32\netprofm.dll
    C:\WINDOWS\system32\napinsp.dll
    C:\WINDOWS\system32\pnrpnsp.dll
    C:\WINDOWS\system32\wshbth.dll
    C:\WINDOWS\system32\NLAapi.dll
    C:\WINDOWS\System32\mswsock.dll
    C:\WINDOWS\System32\winrnr.dll
    C:\WINDOWS\SYSTEM32\igd10iumd64.dll
    C:\WINDOWS\SYSTEM32\ncrypt.dll
    C:\WINDOWS\SYSTEM32\NTASN1.dll
    C:\WINDOWS\SYSTEM32\igdusc64.dll
    C:\WINDOWS\SYSTEM32\dxcore.dll
    C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
    C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
    C:\WINDOWS\System32\npmproxy.dll
    C:\WINDOWS\system32\winhttp.dll
    C:\Windows\System32\rasadhlp.dll
    C:\WINDOWS\System32\fwpuclnt.dll
    C:\WINDOWS\system32\msv1_0.DLL
    C:\WINDOWS\SYSTEM32\NtlmShared.dll
    C:\WINDOWS\SYSTEM32\cryptdll.dll
    C:\WINDOWS\SYSTEM32\edputil.dll
    C:\WINDOWS\SYSTEM32\TextShaping.dll
    

Log in to reply