Can't deploy OpenSSL DLLs with my QT app in the client machine.
-
Hi,
I have been trying to make a QT Desktop app for windows and it uses the API of a webservice and these endpoints are secured with SSL (so it is https).
My app works totally fine on my machine but when it is installed on another one it doesn't. even with OpenSSL installed. By the way i checked the version that is compatible with qt 5.14 which is OpenSSL 1.1.1d (10 sep 2019) and openssl dlls are installed in C:\Windows\System32 as well as the executable (.exe) directory in the client machine.
Here's the code for checking internet as you can tell the requested URL uses https:void checkForInternet(){ QNetworkAccessManager nam; QNetworkRequest req(QUrl("https://www.google.com")); std::cout << QSslSocket::sslLibraryVersionString().toStdString() << std::endl; QByteArray q = QSslSocket::sslLibraryVersionString().toLocal8Bit(); char * c = q.data(); QMessageBox::critical(nullptr, QObject::tr("Error"), QObject::tr(c), QMessageBox::Ok); if(QSslSocket::supportsSsl() == false){ throw exceptionError(100, "Could not initialize a secure tunnel over SSL ERROR_CODE_100"); } QNetworkReply* reply = nam.get(req); QEventLoop loop; connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); loop.exec(); if (reply->bytesAvailable()){ return; // there's internet connection }else{ disconnect(reply, SIGNAL(finished()), &loop, SLOT(quit())); reply->abort(); QMessageBox::critical(nullptr, QObject::tr("Error"), QObject::tr("thers error"), QMessageBox::Ok); throw exceptionError(101, "Connection interrupted with empty response ERROR_CODE_101"); } }
after the above function runs it throws te exception that there's no SSL supported in the client machine.
I really don't think that there is something wrong with the function because it works fine on my machine i think it is something related to OpenSSL.
I tried to copy the openssl dlls from my own machine atC:\Windows\System32
to the client machine and paste them in the same directory but nothin worked even i tried to paste them in the application exe. I made sure that all QT dlls are present in the exe directory.
Please can anyone tell me how to correctly deploy OpenSSL with my app and thanks in advance.
I use QT 5.14 wih MinGW 7.3.0
OpenSSL version is 1.1.1d
on Windows 10 -
Hi
I would use a tool to check if it somehow has unmet dependencies on the client machine so it won't load.
https://github.com/lucasg/Dependenciesit sounds like you copied the needed dlls but have you tried using the OpenSSL installer on the client machine and see if that helps?
If you need something to test on, you can grab a virtual win 10 here
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ -
@hskoglund
I also so mentioned of VS runtime but i dont know
what version currently.