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

How to get http respond from HTTPS?



  • Hi,
    I use Qt5.13.2 on Win 10. I have a php page which is return some information from web server. The website working HTTP before. But now I want to increas security and started to use HTTPS. And now I can not get information from website?

    I use below method to get info from website:

    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
        connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(fileIsReady(QNetworkReply*)) );
        manager->get(QNetworkRequest(QUrl("https://xxx.com/dene/yyy.php")));
    

    I get error below:
    qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

    What should I do now?

    Regards,
    Mucip:)



  • Hi,
    Well, I found this post and it's OK now.
    I used Qt Maintenance to install OpenSSL with the same version of installed Qt and add the openSSL's bin directory to windows path variable.

    restart Qt and all is fine now.
    Please check with yours with below code:

    qDebug()<<"----"<<QSslSocket::sslLibraryBuildVersionString();
    qDebug()<<"----"<<QSslSocket::sslLibraryVersionString();
    

    My resutl now:
    ---- "OpenSSL 1.1.1b 26 Feb 2019"
    ---- "OpenSSL 1.1.1d 10 Sep 2019"

    Regards,
    Mucip:)



  • Hi,
    Well, I found this post and it's OK now.
    I used Qt Maintenance to install OpenSSL with the same version of installed Qt and add the openSSL's bin directory to windows path variable.

    restart Qt and all is fine now.
    Please check with yours with below code:

    qDebug()<<"----"<<QSslSocket::sslLibraryBuildVersionString();
    qDebug()<<"----"<<QSslSocket::sslLibraryVersionString();
    

    My resutl now:
    ---- "OpenSSL 1.1.1b 26 Feb 2019"
    ---- "OpenSSL 1.1.1d 10 Sep 2019"

    Regards,
    Mucip:)


Log in to reply