Important: Please read the Qt Code of Conduct -

QNetworkAccessManager Failed to make connection with https server

  • Hi all,

    I am working on QNetworkAccessManager and I am stuck with it. I have developed my code in QT 4.7.4. and it is working fine on 4.7.4. But when I update from QT4.7.4 to 4.8.0. then my connection failed and finished signal is called with timeout. For more information my project is also working fine on Mac OS X 10.7 with QT 4.8.0. It throws sslError and I simply ignore it. But on Windows no sslError, no error through QNetworkReply. I have installed openSSl and placed lib files in Windows/system directory. By doing this I am able to hit some "https" servers.
    I can communicate with some "https" like gmail servers but it failed on server where I want.

    Please help me out.

    Thanks in advance :).

  • For more information: Below is my code snippet:
    manager = new QNetworkAccessManager(this);
    QNetworkConfigurationManager manager1;
    req.setRawHeader("Content-Type", "application/json+batch");
    QByteArray postData("Hello World");
    QNetworkReply reply= manager->post(req, postData);
    connect(reply , SIGNAL(error(QNetworkReply::NetworkError)) , this , SLOT(error(QNetworkReply::NetworkError)));
    connect(manager , SIGNAL(sslErrors(QNetworkReply
    ,QList<QSslError>)) , this ,SLOT(sslErrors(QNetworkReply*,const QList<QSslError> &)));
    connect(manager , SIGNAL(finished(QNetworkReply*)) , this , SLOT(finished(QNetworkReply*)));
    void ServerTest::sslErrors(QNetworkReply reply, const QList<QSslError> &errors) {
    qDebug("ssl error" + errors.length());
    void ServerTest::finished(QNetworkReply reply) {
    ** Finished **** ");
    QByteArray data = reply->readAll();
    void ServerTest::error(QNetworkReply::NetworkError code) {
    qDebug("Error "+code);

    After 4-5 minutes it only prints "***** finished **********".

    But when I run same project on QT 4.7.4 then I received following out put:
    ssl error
    Finished signal with reply->readAll.

  • I have added "code wrappings,": please remember next time.

Log in to reply