Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error : "Protocol \"https\" is unknown"
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved General and Desktop
qtnetworksslopensslnetworkerror qt
9 Posts 3 Posters 3.6k Views
  • 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.
  • Q Offline
    Q Offline
    Qjay
    wrote on 5 Aug 2019, 14:46 last edited by
    #1

    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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Aug 2019, 14:47 last edited by
      #2

      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
      0
      • Q Offline
        Q Offline
        Qjay
        wrote on 5 Aug 2019, 15:06 last edited by
        #3

        openssl : OpenSSL 1.0.2k-fips 26 Jan 2017

        offline installer for qt

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 6 Aug 2019, 21:04 last edited by
          #4

          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

          Q 1 Reply Last reply 8 Aug 2019, 12:26
          0
          • S SGaist
            6 Aug 2019, 21:04

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

            Q Offline
            Q Offline
            Qjay
            wrote on 8 Aug 2019, 12:26 last edited by
            #5

            @sgaist i am not sure how to check it.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 8 Aug 2019, 12:32 last edited by
              #6

              Hi
              try to install qt and see what version it has

              yum install qt

              check whats installed

              yum list qt*

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                Qjay
                wrote on 14 Aug 2019, 08:58 last edited by
                #7

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

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 14 Aug 2019, 18:56 last edited by
                  #8

                  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
                  0
                  • Q Offline
                    Q Offline
                    Qjay
                    wrote on 16 Aug 2019, 12:42 last edited by
                    #9

                    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
                    1

                    9/9

                    16 Aug 2019, 12:42

                    • Login

                    • Login or register to search.
                    9 out of 9
                    • First post
                      9/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved