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. Android: Downloading from HTTPS does not work

Android: Downloading from HTTPS does not work

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 4 Posters 2.4k 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.
  • P Offline
    P Offline
    PSI_lbc
    wrote on 26 Jan 2019, 19:23 last edited by
    #1

    Qt 5.12 LTS
    Android NDK r14
    Android SDK r25.2.5 for 28.0.2

    Qt Creator 4.8.0
    Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)
Built on Dec 3 2018 13:07:25
From revision d51ddbb8f0

    HTTPS support for Android does not work. It should also be noted that HTTPS works fine on iOS devices.

    On Android 6-8 devices, it causes an app attempting to download a file from an HTTPS url to signal “done” and download nothing.

    Error: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

    D appname: FileDownLoader::RequestFileFromServer..from:  "https://www.companyname.biz/resources/DBs/"
    
    E linker  : library "/system/lib/libcrypto.so" ("/system/lib/libcrypto.so") needed or dlopened by "/data/app/com.companyname.appname-nV0MXGxGe9soTVz8ADNyYw==/lib/arm/libQt5Core.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.companyname.appname-nV0MXGxGe9soTVz8ADNyYw==/lib/arm:/data/app/com.companyname.appname-nV0MXGxGe9soTVz8ADNyYw==/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.companyname.appname"]
    
    W appname: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
    

    HTTP support for Android 6,7,8 works fine. (I have only tested on a device with 8) That is to say..the same exact code accessing a HTTP VS HTTPS url downloads as expected when tested on Android 8.

    In searching for a solution on-line, it appears to be that Android OSes pre-6 all shipped or included SSL support. While that is no longer the case with 6 and up.

    Where do I find pre-compiled libraries that support SSL and HTTPS or whatever else is required to make Qt work on Android 6,7,&8 ?

    Apparently this has already been “bugged” but after 3 months still unresolved:
    https://bugreports.qt.io/browse/QTBUG-71391

    Other than NOT using HTTPS for Android and using HTTP instead..is there a solution?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Jan 2019, 19:32 last edited by SGaist
      #2

      Hi,

      The procedure is explained in the Android dedicated page in Qt's documentation.

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

      P 1 Reply Last reply 28 Jan 2019, 04:41
      1
      • S SGaist
        26 Jan 2019, 19:32

        Hi,

        The procedure is explained in the Android dedicated page in Qt's documentation.

        P Offline
        P Offline
        PSI_lbc
        wrote on 28 Jan 2019, 04:41 last edited by
        #3

        @SGaist

        Thanks. Yes I saw that page.

        @QtCorporation

        I get that I could do that, but what am I paying my monthly $99 license fee for???

        Shouldn't Qt include basic HTTPS functionality and support in their products if they market them as Cross Platform?

        Why would Qt make this the responsibility of each and every Android developer using their product..when they could do it once and make sure it was done correctly????

        Rant finished.

        J 1 Reply Last reply 28 Jan 2019, 06:23
        0
        • P PSI_lbc
          28 Jan 2019, 04:41

          @SGaist

          Thanks. Yes I saw that page.

          @QtCorporation

          I get that I could do that, but what am I paying my monthly $99 license fee for???

          Shouldn't Qt include basic HTTPS functionality and support in their products if they market them as Cross Platform?

          Why would Qt make this the responsibility of each and every Android developer using their product..when they could do it once and make sure it was done correctly????

          Rant finished.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 28 Jan 2019, 06:23 last edited by
          #4

          @PSI_lbc You should read the link posted by @SGaist
          "The Qt installation package comes with OpenSSL support but the OpenSSL libraries are not part of the package due to legal restrictions in some countries."
          Also, if you have a commercial license and want to talk to Qt Company you should contact them directly instead of doing it here. This is a forum where volunteers are helping.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • J Offline
            J Offline
            jgaa
            wrote on 7 Jul 2019, 12:59 last edited by
            #5

            This is clearly about the worst possible way to do this.

            Most (for all practical purposes - all) applications that use any kind of external WEB/REST/Websockets API's will use https .

            In stead of forcing each and every developer to manually add openssl to the build, creating friction with and frustration about Qt in the process, - why don't you just provide a button in the build or project settings where we can enable openssl for that build / project?

            That will solve the legal problem, and save quite a few wasted hours for developers.

            I was planning to showcase a Qt/QML application for Linux Desktop and Android tomorrow - but I'm not wasting a Sunday on this BS. Now I will go for a walk with my dogs, and just forget about the Android demo. Linux Desktop will do. If someone in the audience asks why I don't have an Android build, I'll just admit it was too much work.

            J 1 Reply Last reply 8 Jul 2019, 06:59
            2
            • J jgaa
              7 Jul 2019, 12:59

              This is clearly about the worst possible way to do this.

              Most (for all practical purposes - all) applications that use any kind of external WEB/REST/Websockets API's will use https .

              In stead of forcing each and every developer to manually add openssl to the build, creating friction with and frustration about Qt in the process, - why don't you just provide a button in the build or project settings where we can enable openssl for that build / project?

              That will solve the legal problem, and save quite a few wasted hours for developers.

              I was planning to showcase a Qt/QML application for Linux Desktop and Android tomorrow - but I'm not wasting a Sunday on this BS. Now I will go for a walk with my dogs, and just forget about the Android demo. Linux Desktop will do. If someone in the audience asks why I don't have an Android build, I'll just admit it was too much work.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 8 Jul 2019, 06:59 last edited by jsulm 7 Aug 2019, 06:59
              #6

              @jgaa You're welcome to submit improvement ideas on the Qt developers mailing list or Qt bug tracker.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

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