Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't deploy OpenSSL DLLs with my QT app in the client machine.
Forum Updated to NodeBB v4.3 + New Features

Can't deploy OpenSSL DLLs with my QT app in the client machine.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 441 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the1dev
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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/

      1 Reply Last reply
      2
      • T Offline
        T Offline
        the1dev
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          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.

          mrjjM 1 Reply Last reply
          2
          • hskoglundH hskoglund

            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.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved