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

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 at C:\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


  • Lifetime Qt Champion

    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/Dependencies

    it 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/



  • Yesi tried to install using the installer but failed. I even tries all openssl versions to avoid incompatibility.



  • Hi, even though you are using MinGW compiler I think OpenSSL uses Microsoft C runtime dlls, perhaps those dlls are missing from the client machine.


  • Lifetime Qt Champion

    @hskoglund
    I also so mentioned of VS runtime but i dont know
    what version currently.


Log in to reply