Solved no SSL support on Windows just for few users...
-
Hi,
I don't understand why on certain environments (Win10 64bit or Server 2019), Windows is not loading the SSL dlls (libssl-1_1-x64.dll and libcrypto-1_1-x64.dll) and thus I don't get SSL support...
I've read many posts on what could be wrong... and mainly it should be the dll included.
So I'm building on Windows with Qt v5.12.5 with MinGW 7.3 64bit.
I provide with the app:; dlls Source: "{#ApplicationBuildDir}\libs\libcrypto-1_1-x64.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#ApplicationBuildDir}\libs\libgcc_s_seh-1.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#ApplicationBuildDir}\libs\libssl-1_1-x64.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#ApplicationBuildDir}\libs\libstdc++-6.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#ApplicationBuildDir}\libs\libwinpthread-1.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion ; Qt dlls Source: "{#QtBinDir}\Qt5Core.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#QtBinDir}\Qt5DBus.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#QtBinDir}\Qt5Gui.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#QtBinDir}\Qt5Network.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion Source: "{#QtBinDir}\Qt5Widgets.dll"; DestDir: "{#DestinationDir}"; Flags: ignoreversion ; Qt plugins Source: "{#QtPluginsDir}\bearer\qgenericbearer.dll"; DestDir: "{#DestinationDir}\bearer"; Flags: ignoreversion Source: "{#QtPluginsDir}\platforms\qwindows.dll"; DestDir: "{#DestinationDir}\platforms"; Flags: ignoreversion
libssl-1_1-x64.dll and libcrypto-1_1-x64.dll were v1.1.1c, those provided with Qt Tools.
I've noticed, Qt v5.12 is built using v1.1.1b
So I've asked my users having issue with No SSL support to try to replace the dlls with those of 1.1.1b (available here) but the problem is the same...I've this output:
if (_ngPost->debugMode()) _log(QString("SSL support: %1, build version: %2, system version: %3").arg(QSslSocket::supportsSsl() ? "yes" : "no").arg( QSslSocket::sslLibraryBuildVersionString()).arg(QSslSocket::sslLibraryVersionString()));
And they're still getting this output: "SSL support: no, build version: OpenSSL 1.1.1b 26 Feb 2019, system version:"
I'm running out of ideas...
Just a few persons have this issue. Most of the users don't have any problem. (using the same setup file for deployment so having the same dlls...)I've found Microsoft ListDLLs tool and asked the user to run it. Here is his output. We clearly see that both openssl dll are not loaded. Any idea why?
To compare, here is the output of ListDlls on my Win7 VM that properly loads openssl dlls.Could it come from windows CRYPT32.dll or CRYPTBASE.DLL? He's having a much more recent version than mine (10.0.18362.1 rather then 6.1.7601.17514)
I'm completely running out of ideas...
What would you suggest to try? -
Hi, 2 suggestions for the problematic users: try disabling the ESET antivirus and also try downloading the MSVC2015 redistributable (early Windows 10 versions does not have it).
-
@hskoglund said in no SSL support on Windows just for few users...:
Hi, 2 suggestions for the problematic users: try disabling the ESET antivirus and also try downloading the MSVC2015 redistributable (early Windows 10 versions does not have it).
They tried already without firewall (not antivirus) but I can ask...
Why would they need msvc? I'm using mingw version... (their win10 version is supposed to be newer than the one I'm testing on successfully (I'm having win7)) -
Hi,
Do you mean of Qt or OpenSSL ? Both ?
-
@SGaist said in no SSL support on Windows just for few users...:
Hi,
Do you mean of Qt or OpenSSL ? Both ?
Not sure what you mean. It's my Qt app that is not getting SSL support.
They don't have openssl installed I suppose.
I'm providing openssl dlls in the folder of my app. BUT windows is not loading them... not sure why?
Should I maybe rename them to remove the version number? -
You may have your Qt version built with MinGW and OpenSSL built with MSVC.
In any case, you can check if you have everything required using Dependency Walker on these .dlls.
-
@SGaist said in no SSL support on Windows just for few users...:
You may have your Qt version built with MinGW and OpenSSL built with MSVC.
In any case, you can check if you have everything required using Dependency Walker on these .dlls.
What sould I open with the dependency walker? neither my app nor Qt5Network depends on libssl... it's hidden as it's not necessarily needed...
How can I know if the libssl dlls are built with mingw or msvc?
What about those provided with Qt Tools? (Qt\Tools\Openssl\win_x64\bin)
I suppose that's the MinGW versions as the SSL support is working for most Windows environment.
I've this issue only for few users. So I'd think it's a loading issue...
If you look at my log of the Dlls loaded on my win7, you can see that the dll I'm supplying are loaded. -
Open the OpenSSL dlls with Dependency Walker.
Qt dlopen's the OpenSSL libraries. It's not compiled against it because of some international law with regard to distributing encryption enabled software.
As @hskoglund already suggested, you might be missing the runtime required by the OpenSSL dlls.
-
So would that be MSVC*.DLL we can see there
Can I provide those dlls within my app next to libssl and libcrypto or does the user HAS to install MSVC2015 redistributable?
Is it possible to find Windows libssl dlls compiled with MinGW?
-
I have no insight into the specific problem here but, if you don't get anywhere with Dependency Walker, Process Monitor can also be very useful in tracking down reasons for DLL loading issues.
-
MSVCR100.dll means that you need to check whether the computer having issue are missing that version of the Microsoft runtime libraries. One other way is to make them part of your application release.
-
@Bob64 said in no SSL support on Windows just for few users...:
I have no insight into the specific problem here but, if you don't get anywhere with Dependency Walker, Process Monitor can also be very useful in tracking down reasons for DLL loading issues.
The problem is that I don't have the issue on my environment. Only one user gets the issue on his computer. He tested on another one (his wife) and it's working fine. So it's pretty difficult to debug...
-
hum, he has errors in WS2_32.DLL...
So I guess nothing I can do within the app...
He must install MSVC2015 redistributable?
are we sure that this is what's missing? why MSVC2015 and not MSVC2017 or more recent?Edit: that's crap, is there a way to find dlls (maybe compiled with MinGW) that would not need that?
or can I provide all those api-ms-win-core*.dll within my app? -
@mbruel If possible, get the user to install Process Monitor in the problematic environment and send you the log. Sometimes this allows you to pinpoint what is failing to load, especially if you can cross reference a log from a successful environment. I wouldn't necessarily recommend this unless you really are stuck, as it can be a lot of work, but it has got me out of a hole on a few occasions.
-
@Bob64 said in no SSL support on Windows just for few users...:
get the user to install Process Monitor in the problematic environment and send you the log
I don't know how to use Process Monitor, on my win7 VM (I'm on Debian), it's failing to open due to lack of drivers.
My user tried to install msvc2015 redistributable, it didn't make the SSL work.
He tried to copy the msvcr100.dll I provided him. and now it is working.How come libssl v1.1.1 (from 2019) could still depend on msvc 2010? oO
Is there a way to build openssl to not have those msvc dependencies? -
Why 2010 ? Backward compatibility with really old systems I would guess.
-
@SGaist yeah but then not compatible with newest versions out of the box... :\
-
I suppose Qt MinGW version is built agains this libssl version requiring msvc 2010 right?
So even if I wanted, I couldn't compile it myself (libssl) without msvc and providing it.
Is it right? -
@mbruel Hi ,if you use mingw or mingw-w64 you can compile openssl with it from the sources, and then compile Qt from the sources, with the support of openssl (option in configure of Qt)
-
Hi! @mbruel .
Please try lucasg/Dependencies. It's A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues. This tool can resolve dependencies with the dlls from Windows API Sets.
By the way, there are still some bugs in the latest release version (f.e., Dependencies#102). You can checkout the newest build from CI, or wait for the next release.