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. If your application depends on OpenSSL, consider packaging the SSL libraries with your Application Package (APK) as the target device may or may not have them. You can use the QSslSocket::supportsSsl() static function to check for SSL support on the target.
The following instructions guide you to build and add the OpenSSL libraries to the APK:
Note: If your development platform is Windows, you need msys
with perl
v5.14 or later to build OpenSSL.
export PATH="<android_ndk_path>/toolchains/llvm/prebuilt/<host>/bin":$PATH
./Configure shared android-<arch> -D__ANDROID_API__=21
Note: You must consider enabling/disabling the SSL features based on the legal restrictions in the region where your application is available. See the SSL configure options for details about the configurable features.
make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" build_libs
to build the libcrypto
and libssl
shared libraries that are not versioned.Note: Android does not load versioned libraries.
Note: here https://github.com/KDAB/android_openssl you can find a script which can be used to compile openssl for all android abis and also latest prebuilt libs.
Qt Creator builds your application and creates an application package (APK) with the OpenSSL libraries bundled in it. Once the APK is ready, it uses adb
to deploy the APK on the target you chose and launch the application.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.13/android-openssl-support.html