Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error: Protocol "https" is unknown
Forum Updated to NodeBB v4.3 + New Features

Error: Protocol "https" is unknown

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
14 Posts 5 Posters 888 Views 1 Watching
  • 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.
  • J jabille

    Hello.

    I am developing an app for a Linux unattended terminal (U1000) using Qt 5.2.1 C++.
    Currently I am restricted to this version as the vendor has yet to support newer versions.

    I have a QNetworkRequest that runs well when I run the app on Windows. Both http and https works.
    But when I deploy to the device, I am getting: Error: Protocol "https" is unknown.

    I checked the device via adb with openssl version and it has OpenSSL 1.0.2t 10 Sep 2019.
    I have also downloaded OpenSSL in the Qt maintenance tool.

    Here is my request:

    void NetworkManager::fetchData() {
        // Setup network manager
        QUrl url("https://jsonplaceholder.typicode.com/posts/1");
        QNetworkRequest request(url);
    
        // Make the GET request
        reply = manager.get(request);
    
        // Connect reply's finished signal to the slot
        connect(reply, SIGNAL(finished()), this, SLOT(handleNetworkReply()));
    }
    

    and a snippet of my .pro file:

    LIBS += -LC:/NPT_SDK/Linux/Compiler/4.9.4/arm-linux-gnueabi/libc/usr/lib/ -lssl -lcrypto
    
    Ronel_qtmasterR Offline
    Ronel_qtmasterR Offline
    Ronel_qtmaster
    wrote on last edited by Ronel_qtmaster
    #2

    @jabille have you checked if it supports SLL using QSslSocket::supportsSsl() ?
    If yes , you have to link your app with the exact openssl libs and corresponding to the openssl installed version.
    For linux, you can try android openssl libraries. check this https://github.com/KDAB/android_openssl

    J 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Hi,

      As @Ronel_qtmaster wrote, you need matching OpenSSL but only the series should be the same e.g. 0.9, 1.0, 1.1 (it's not compatible with 1.0).
      Also, you have to ensure that Qt is built with OpenSSL support.

      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
      1
      • Ronel_qtmasterR Ronel_qtmaster

        @jabille have you checked if it supports SLL using QSslSocket::supportsSsl() ?
        If yes , you have to link your app with the exact openssl libs and corresponding to the openssl installed version.
        For linux, you can try android openssl libraries. check this https://github.com/KDAB/android_openssl

        J Offline
        J Offline
        jabille
        wrote on last edited by jabille
        #4

        @Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.

        Error is: Use of undeclared identifier QSslSocket

        jsulmJ SGaistS 2 Replies Last reply
        0
        • J jabille

          @Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.

          Error is: Use of undeclared identifier QSslSocket

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5
          This post is deleted!
          1 Reply Last reply
          0
          • J jabille

            @Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.

            Error is: Use of undeclared identifier QSslSocket

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @jabille said in Error: Protocol "https" is unknown:

            @Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.

            Error is: Use of undeclared identifier QSslSocket

            As silly as it may sound: did you include the proper header ?

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

            J 1 Reply Last reply
            1
            • SGaistS SGaist

              @jabille said in Error: Protocol "https" is unknown:

              @Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.

              Error is: Use of undeclared identifier QSslSocket

              As silly as it may sound: did you include the proper header ?

              J Offline
              J Offline
              jabille
              wrote on last edited by
              #7

              @SGaist Yes. I #include <QSslSocket> and it the code is building properly on my Qt 6.7.3 Kit (Windows) but not on my Qt 5.2.1 Kit (Generates package installed to Linux device).

              jsulmJ 1 Reply Last reply
              0
              • J jabille

                @SGaist Yes. I #include <QSslSocket> and it the code is building properly on my Qt 6.7.3 Kit (Windows) but not on my Qt 5.2.1 Kit (Generates package installed to Linux device).

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @jabille QSslSocket is available since Qt 4.3.
                Do you have

                QT += network
                

                in your pro file?
                How did you install Qt 5.2.1? Maybe network module is missing in this Qt installation?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by SGaist
                  #9

                  Beside the question from @jsulm, are you sure that version of Qt was built with OpenSSL support ?

                  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
                  • J Offline
                    J Offline
                    jabille
                    wrote on last edited by
                    #10

                    Yes, I also have QT += network. I can confirm that network module is there.
                    I am able to get a proper response for a QNetworkRequest in 5.2.1 but only in http. If I set the url to https, I get the error: Protocol https is unknown. QNetworkAccessManager supportedSchemes() also does not list https.

                    How do I check if it has OpenSSL support other than QSslSocket::supportsSsl()? The thing is that the qt5.2.1-arm-linux came from the device vendor. It is included in their SDK. So, they might be some things that are missing.

                    Also, sorry if I am replying to both of you at once. I can only post every 600 seconds as a newbie here.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      You have the answer: the class is not available so it was not built with OpenSSL support.

                      You have to check with your vendor.

                      On that note, seeing the version of Qt, the versions of OpenSSL supported at that time are also now obsolete so I would highly recommend considering porting to a more recent version of Qt.

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

                      J 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        You have the answer: the class is not available so it was not built with OpenSSL support.

                        You have to check with your vendor.

                        On that note, seeing the version of Qt, the versions of OpenSSL supported at that time are also now obsolete so I would highly recommend considering porting to a more recent version of Qt.

                        J Offline
                        J Offline
                        jabille
                        wrote on last edited by
                        #12

                        @SGaist I see. I'll talk to the vendor regarding this.
                        When I tried to copy the path of the #include <QSslSocket>, I can see that it is in the C:\NPT_SDK\Linux\Core\third-party\qt5.2.1-arm-linux\include\QtNetwork and inside qsslsocket.h there is a flag QT_NO_SSL. Maybe that is why it is disabled? I have no clue how that is set or where it's from.

                        jsulmJ 1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by
                          #13

                          Also, to verify that your SSL works, you can try to compile and run the Secure Socket Client example app in Qt 5.2.1

                          1 Reply Last reply
                          0
                          • J jabille

                            @SGaist I see. I'll talk to the vendor regarding this.
                            When I tried to copy the path of the #include <QSslSocket>, I can see that it is in the C:\NPT_SDK\Linux\Core\third-party\qt5.2.1-arm-linux\include\QtNetwork and inside qsslsocket.h there is a flag QT_NO_SSL. Maybe that is why it is disabled? I have no clue how that is set or where it's from.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #14

                            @jabille said in Error: Protocol "https" is unknown:

                            Maybe that is why it is disabled?

                            No, it is there because Qt was built without SSL support. You need a Qt build with SSL support.

                            1 Reply Last reply
                            0

                            • Login

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