Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. OpenSSL 1.1.1c Toolkit in clean Windows 10
Forum Updated to NodeBB v4.3 + New Features

OpenSSL 1.1.1c Toolkit in clean Windows 10

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 3 Posters 1.4k 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.
  • H Offline
    H Offline
    Harrix
    wrote on last edited by
    #1

    I have the last version Qt 5.13.0 (online installer) with OpenSSL 1.1.1c Toolkit . I created simple QtWidget application with one https request (MinGW 64bit). I added the path D:\Qt\Tools\OpenSSL\Win_x64\bin to the system variable PATH.

    QT       += core gui network
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = untitled1
    TEMPLATE = app
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
    {
      ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
      delete ui;
    }
    
    void MainWindow::on_pushButton_clicked()
    {
      QNetworkAccessManager *manager;
      QNetworkRequest request;
      QSslConfiguration sSlConfig;
    
      sSlConfig.setDefaultConfiguration(QSslConfiguration::defaultConfiguration());
      sSlConfig.setProtocol(QSsl::TlsV1_2);
      request.setSslConfiguration(sSlConfig);
    
      request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
    
      manager = new QNetworkAccessManager(this);
      connect(manager, SIGNAL(finished(QNetworkReply*)),
              this, SLOT(replyFinished(QNetworkReply*)));
    
      request.setUrl(QUrl("https://www.google.com/"));
    
      manager->get(request);
    }
    
    void MainWindow::replyFinished(QNetworkReply* reply) {
      if (reply->error() == QNetworkReply::NoError) {
        QByteArray bytes = reply->readAll();
        QString html = QString::fromUtf8(bytes.data(), bytes.size());
    
        int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
    
        QString url = reply->url().toString();
    
        ui->textEdit->insertPlainText("statusCode = " + QString::number(statusCode) + "\n");
        ui->textEdit->insertPlainText("url = " + url + "\n");
        ui->textEdit->insertPlainText("html = " + html + "\n");
      } else {
        qDebug() << reply->errorString();
      }
    
      reply->deleteLater();
    }
    

    And application works.

    Then I want to run the EXE file in a clean Windows 10. For running an application I use these dll:

    • libgcc_s_seh-1.dll
    • libstdc++-6.dll
    • libwinpthread-1.dll
    • Qt5Core.dll
    • Qt5Gui.dll
    • Qt5Network.dll
    • Qt5Widgets.dll
    • platforms
    • └───qwindows.dll

    Apllication runs, but https request does not work. I understand that I need to add dll files for OpenSSL. But https request do not work again after adding dll files from D:\Qt\Tools\OpenSSL\Win_x64\bin:

    • libcrypto-1_1-x64.dll
    • libssl-1_1-x64.dll

    But when I use vesrions of these dll files from https://slproweb.com/products/Win32OpenSSL.html (Win64 OpenSSL v1.1.1c) my application works in clean Windows 10 (after installing vc_redist.x64.exe).

    What could be the problem with the files libcrypto-1_1-x64.dll and libssl-1_1-x64.dll in the folder D:\Qt\Tools\OpenSSL\Win_x64\bin?

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

      Hi,

      Likely because they are not built with the same compiler. Qt Creator is built with Visual Studio while you are using MinGW.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Likely because they are not built with the same compiler. Qt Creator is built with Visual Studio while you are using MinGW.

        H Offline
        H Offline
        Harrix
        wrote on last edited by
        #3

        @SGaist No. Files from slproweb.com compiled under Visual Studio and require vc_redist.x64.exe. But they work with my apllication compiled under MinGW 64bit.

        And now I compiled my test application under MSVC2017 64bit. And situation is the same. Files from slproweb.com work with the application, but files from D:\Qt\Tools\OpenSSL\Win_x64\bin do not work in a clean Windows 10.

        D 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Right ! These are C libraries !

          Check these .dlls with Dependency Walker, you might find so what differs between these sets.

          By the way, can you check which version of Qt was used to build Qt Creator ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • H Harrix

            @SGaist No. Files from slproweb.com compiled under Visual Studio and require vc_redist.x64.exe. But they work with my apllication compiled under MinGW 64bit.

            And now I compiled my test application under MSVC2017 64bit. And situation is the same. Files from slproweb.com work with the application, but files from D:\Qt\Tools\OpenSSL\Win_x64\bin do not work in a clean Windows 10.

            D Offline
            D Offline
            DoHuuVi
            wrote on last edited by
            #5

            @Harrix Did you resolve this? I have the same issue. If I install Qt/Felgo on the clean pc, the app can work. I think I'm missing a dll when deploying the app.

            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