Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Error : "Protocol \"https\" is unknown"

    General and Desktop
    qtnetwork ssl openssl network error qt
    3
    9
    2147
    Loading More Posts
    • 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.
    • Qjay
      Qjay last edited by

      Hello i am trying to make a request to HTTPS url , i am getting following error
      Error : "Protocol \"https\" is unknown"

      below code works fine for the HTTP request but not for HTTPS

      #include <QCoreApplication>
      #include <QNetworkAccessManager>
      #include <QNetworkRequest>
      #include <QNetworkReply>
      #include <QUrl>
      #include <QUrlQuery>
      #include <QDebug>
      #include <QString>
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
           QString requested_url = "https://www.google.com";
      
          // create custom temporary event loop on stack
          QEventLoop eventLoop;
      
          // "quit()" the event-loop, when the network request "finished()"
          QNetworkAccessManager mgr;
          QObject::connect(&mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
      
          // the HTTP request
          QNetworkRequest req( requested_url );
      
          QSslConfiguration conf = req.sslConfiguration();
          conf.setPeerVerifyMode(QSslSocket::VerifyNone);
          req.setSslConfiguration(conf);
      
      
          QNetworkReply *reply = mgr.get(req);
          eventLoop.exec();
      
          if (reply->error() == QNetworkReply::NoError) {
      
      	qDebug() << (QString)reply->readAll();
      
      
          }
          else {
      	qDebug() << "Error : " << reply->errorString();
      }
          return a.exec();
      }
      

      i am using Qt 5.9.2 on CentOS 7

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        How did you install Qt ?
        What version of OpenSSL do you have installed ?

        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 Reply Quote 0
        • Qjay
          Qjay last edited by

          openssl : OpenSSL 1.0.2k-fips 26 Jan 2017

          offline installer for qt

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Do you have the same issue if you use your distribution provided Qt ?

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

            Qjay 1 Reply Last reply Reply Quote 0
            • Qjay
              Qjay @SGaist last edited by

              @sgaist i am not sure how to check it.

              1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion last edited by

                Hi
                try to install qt and see what version it has

                yum install qt

                check whats installed

                yum list qt*

                1 Reply Last reply Reply Quote 0
                • Qjay
                  Qjay last edited by

                  hello i have Qt from here : https://download.qt.io/official_releases/qt/5.9/5.9.2/

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    Hence our suggestions: use your distribution package manager to install Qt and test that this version is working properly first.

                    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 Reply Quote 0
                    • Qjay
                      Qjay last edited by

                      hey i didn't fixed it . i downloaded Qt5.12.4 and then upgraded my openssl lib to 1.1.1b

                      so i am good now
                      thanks !!

                      1 Reply Last reply Reply Quote 1
                      • First post
                        Last post