Issues loading OpenSSL on Deploy
-
Hi, I have an application migrated from Qt 5.11.2 to Qt 6.2.3. It worked fine on v5.11 and v5.15 and also has no issues in Qt Creator after migrated to v6.2. But it seems like it is not loading OpenSSL dlls once deployed using windeployqt. First, here is my env:
OS: Windows 10/Windows 11 x64 Qt version: 6.2.2/6.2.3 msvc: 2019 x64
log in Qt Creator:
[2022-02-25T10:36:38-08:00] INFO: {app } Supports SSL :: true [2022-02-25T14:08:51-08:00] INFO: {app} OpenSSL Library :: 269488303 [2022-02-25T14:08:51-08:00] INFO: {app} Compile Time OpenSSL Build :: OpenSSL 1.1.1k 25 Mar 2021 [2022-02-25T14:08:51-08:00] INFO: {app} Run Time OpenSSL Build :: OpenSSL 1.1.1j 16 Feb 2021 ...
log once deployed:
[2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] INFO: {app} Supports SSL :: false [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] INFO: {app} OpenSSL Library :: -1 [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] INFO: {app} Compile Time OpenSSL Build :: [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] INFO: {app} Run Time OpenSSL Build :: ... [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No functional TLS backend was found [2022-02-25T13:21:37-08:00] WARNING: {qt.network.ssl} No TLS backend is available ...
According to the doc on Qt for Windows - Deployment, "if Qt was configured to link against ICU or OpenSSL, the respective DLL's need to be added to the release folder, too." So before running windeployqt, I added libcrypto-1_1-x64.dll and libssl-1_1-x64.dll from Qt\Qt6.2.2\Tools\OpenSSL\Win_x64\bin to the release (or out) folder. Still, the windeployqt log doesn't say anything about these two dlls but do create/update following 3 TLS dlls.
windeployqt log:
.\windeployqt.exe "C:\dev\<app name>\src\<build folder>\out" ... Creating directory C:/dev/<app name>/src/<build file>/out/tls. Updating qcertonlybackend.dll. Updating qopensslbackend.dll. Updating qschannelbackend.dll. ...
Also when I tried to debug what dlls are loaded into the application using VS2019, I'm not seeing any of these TLS and OpenSSL dlls loaded.
What I tried so far:
- Adding dll locations to PATH (although I believe having them next to the executable should be fine)
- Manually loading dlls in .pro file (i.e win32:LIB += libcrypto-1_1-x64.dll)
- Using v1.1.1m OpenSSL downloaded from https://slproweb.com/products/Win32OpenSSL.html
- Using v1.1.1j OpenSSL downloaded from the Qt maintenance tool
Seeing SSL support is false I feel like I'm missing something. Maybe I should build v1.1.1k from source? Any hints would be greatly appreciated. Thanks!