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. OpenSSL for Android support

OpenSSL for Android support

Scheduled Pinned Locked Moved Solved Mobile and Embedded
23 Posts 11 Posters 11.5k 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.
  • U Offline
    U Offline
    Unix One
    wrote on last edited by
    #13

    A couple of updates:

    • I tried compiling openssl-1.1.0h (current stable version) against the old android ndk (r10e) because people seem to have reported that working. Well, it compiled, but it didn't work in the app. The errors were similar to the ones I got with @mateczek's script. I also noticed
      qt.network.ssl: Incompatible version of OpenSSL
      error, but that could have been present with @mateczek's result too, and I could have just missed it. So, it resulted in a similar output.
    • Then I decided to give openssl-1.0.2o (current stable LTS version) a try. To my astonishment, it compiled, and it worked in the app!

    So, the conclusion is:

    • use openssl-1.0.x LTS version, until it's supported
    • use android-ndk-r10e, until it's supported
    • use these instructions

    The remaining question: is this a known issue? Is there a bug to update openssl support to more recent openssl and android ndk versions?

    For reference, I run OpenSUSE Tumbleweed and keep it updated. Qt Creator 4.7.0. Qt 5.11.1. I'm happy to test and provide additional information if anyone has any ideas.

    Pablo J. RoginaP 1 Reply Last reply
    1
    • U Unix One

      A couple of updates:

      • I tried compiling openssl-1.1.0h (current stable version) against the old android ndk (r10e) because people seem to have reported that working. Well, it compiled, but it didn't work in the app. The errors were similar to the ones I got with @mateczek's script. I also noticed
        qt.network.ssl: Incompatible version of OpenSSL
        error, but that could have been present with @mateczek's result too, and I could have just missed it. So, it resulted in a similar output.
      • Then I decided to give openssl-1.0.2o (current stable LTS version) a try. To my astonishment, it compiled, and it worked in the app!

      So, the conclusion is:

      • use openssl-1.0.x LTS version, until it's supported
      • use android-ndk-r10e, until it's supported
      • use these instructions

      The remaining question: is this a known issue? Is there a bug to update openssl support to more recent openssl and android ndk versions?

      For reference, I run OpenSUSE Tumbleweed and keep it updated. Qt Creator 4.7.0. Qt 5.11.1. I'm happy to test and provide additional information if anyone has any ideas.

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #14

      @Unix-One said in OpenSSL for Android support:

      The remaining question: is this a known issue? Is there a bug to update openssl support to more recent openssl and android ndk versions?

      Checking Qt's source code, you'll find that OpenSSL 1.1.x is not yet supported...

      ...
      if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
              // OpenSSL 1.1 has deprecated and removed SSLeay. We consider a failure to
              // resolve this symbol as a failure to resolve symbols.
              // The right operand of '||' above is ... a bit of paranoia.
              delete libs.first;
              delete libs.second;
              qCWarning(lcSsl, "Incompatible version of OpenSSL");
              return false;
          }
      ...
      

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

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

        OpenSSL 1.1 has a backend in Qt since Qt 5.10 but you have to build Qt by hand in order to use it currently.

        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
        2
        • U Offline
          U Offline
          Unix One
          wrote on last edited by
          #16

          @Pablo-J-Rogina @SGaist that is good to know - would have been useful information on the instructions page that would potentially save developers a lot of time. I might update the wiki with the basic steps for minimum android packaging and deployment (given I find enough time of course).

          Thank you all for your help.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AlfredoC
            wrote on last edited by
            #17

            Hi,
            I had a lot of trouble with openssl and qt with android too.
            So I wrote a post how to solve the problems.
            Hope this helps.

            K ekkescornerE 2 Replies Last reply
            1
            • A AlfredoC

              Hi,
              I had a lot of trouble with openssl and qt with android too.
              So I wrote a post how to solve the problems.
              Hope this helps.

              K Offline
              K Offline
              Knox
              wrote on last edited by
              #18

              @AlfredoC concerning your guide, i have setup a VM so that i could build the apk in ubuntu (i have given up doing it in windows) ubuntu 10.10 runs openssl v 1.1.1. as in your guide says that that wont do, how actually do i use 1.0.2p? can i install it directly? or do i just extract it? im sorry very noob question here.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AlfredoC
                wrote on last edited by
                #19

                you have to download the openssl source, compile it for Android as described and copy the 2 libraries to your project.
                If you trust me, you can download the precompiled libs here ;-)

                1 Reply Last reply
                1
                • A AlfredoC

                  Hi,
                  I had a lot of trouble with openssl and qt with android too.
                  So I wrote a post how to solve the problems.
                  Hope this helps.

                  ekkescornerE Offline
                  ekkescornerE Offline
                  ekkescorner
                  Qt Champions 2016
                  wrote on last edited by
                  #20

                  @AlfredoC hint to your blog post: Qt 5.12 now uses NDK r18b

                  ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                  5.15 --> 6.8 https://t1p.de/ekkeChecklist
                  QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                  1 Reply Last reply
                  1
                  • 1 Offline
                    1 Offline
                    10Exahertz
                    wrote on last edited by
                    #21

                    @Alfredo Thank you for the blog post but I'm still having trouble, when I get to the "make depend" part it gives me this error:

                    "GCC, does not understand command line option "-mandroid""
                    Based on a google search I'm not using the right GCC, im using (x86) and not the android one in the NDK?

                    Im confused as to how to do this properly.

                    1 Reply Last reply
                    0
                    • ekkescornerE Offline
                      ekkescornerE Offline
                      ekkescorner
                      Qt Champions 2016
                      wrote on last edited by
                      #22

                      have not tried yet, but this looks great: https://github.com/akontsevich/openssl-android-build

                      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                      5.15 --> 6.8 https://t1p.de/ekkeChecklist
                      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                      1 1 Reply Last reply
                      3
                      • ekkescornerE ekkescorner

                        have not tried yet, but this looks great: https://github.com/akontsevich/openssl-android-build

                        1 Offline
                        1 Offline
                        10Exahertz
                        wrote on last edited by
                        #23

                        This one worked like a charm, took 10 min overall.

                        https://github.com/ekke/android-openssl-qt

                        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