Important: Please read the Qt Code of Conduct -

Qt Https request with openssl - No response

  • Hey guys,
    I'm trying to get my problem solved the last days, but I can't. I've read many forums but unfortunately I've found no solution, maybe someone can help me.

    My intention is to communicate with an webservice. The code should work, but when I'm executing it, I don't get any answer. I should receive some information about my request, but there is no response. Did I miss something? I've also included some openssl libraries. In the .pro file as well as on the system. At the moment I'm running windows 10 with Qt 5.11 on it.
    I've read about some issues according to the incompatibility between Qt 5.11 and openssl 1.1.0, so I've already installed 1.0.2. But nothing...

    Here is my code for the request:

    Testing::Testing(QObject *parent) :
    QObject (parent)
    connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
    // no proxy
    void Testing::doRequest()
    // request
    QString requestURL = QString("");
    QUrl url(requestURL);
    QNetworkRequest request;
    QNetworkReply* currentReply = manager.get(request);  // GET
    void Testing::replyFinished(QNetworkReply *reply)
    if (reply->error())
        qWarning() << "ErrorNo: " << reply->error() << "for url: " << reply->url().toString();
        qDebug() << "Request failed, " << reply->errorString();
        qDebug() << "Content: " << reply->readAll();
    int main(int argc, char *argv[])
    Testing t;

    Here is my .pro file:

    QT      += core
    QT      += network
    QT      -= gui
    HEADERS += \
    accountmanager.h \
    radiostationlist.h \
    radiostation.h \
    SOURCES += \
    demo.cpp \
    accountmanager.cpp \
    radiostationlist.cpp \
    radiostation.cpp \
    LIBS += E:/Programme/OpenSSL-Win64/lib/libeay32.lib
    LIBS += E:/Programme/OpenSSL-Win64/lib/ssleay32.lib

    That's the console output:

    C:/Users/thanh/Desktop/build-Alpini-Desktop_Qt_5_11_2_MinGW_32bit-Debug/debug/Alpini wurde mit dem 
    R├╝ckgabewert 0 beendet

    Hopefully, there is somebody who can help me.

    Best regards,

  • Qt Champions 2017

    Can create the QApplication object & Start the event loop like follows ?

    int main(int argc, char *argv[])
    QApplication a(argc,argv)
    Testing t;

  • It wooooorked, thank you so muuuuch :)