Bug 447499 - TLS initialization failed on Android
Summary: TLS initialization failed on Android
Status: RESOLVED FIXED
Alias: None
Product: kid3
Classification: Applications
Component: general (show other bugs)
Version: 3.9.x
Platform: Android Android 7.x
: NOR normal
Target Milestone: ---
Assignee: Urs Fleisch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-25 09:23 UTC by Urs Fleisch
Modified: 2021-12-25 12:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Urs Fleisch 2021-12-25 09:23:49 UTC
SUMMARY
With Kid3 3.9.0 on Android, it is not possible to connect to servers (such as MusicBrainz, Discogs) via HTTPS.

STEPS TO REPRODUCE
1. Open a folder in Kid3
2. Menu, Automatic Import, Profile: MusicBrainz, START

OBSERVED RESULT
The following message is displayed: "Error: TLS initialization failed"

EXPECTED RESULT
Metadata for the album are imported from MusicBrainz

SOFTWARE/OS VERSIONS
Android: 7.1.2, 11 (LineageOS 18.1)
Qt Version: 5.12.12
Kid3: 3.9.0

ADDITIONAL INFORMATION
I investigated the issue. It is caused by the update of Qt from 5.12.4 to 5.12.12. Qt now requires the SSL libraries to be named libssl_1_1.so and libcrypto_1_1.so instead of libssl.so and libcrypto.so. Without the versioned names, it tries to take the system libraries

W linker  : library "/system/lib/libcrypto.so" ("/system/lib/libcrypto.so") needed or dlopened by "/data/app/net.sourceforge.kid3-1/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
W linker  : library "/system/lib/libssl.so" ("/system/lib/libssl.so") needed or dlopened by "/data/app/net.sourceforge.kid3-1/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
W Kid3    : qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

See also
https://forum.qt.io/topic/98985/android-downloading-from-https-does-not-work/4
https://doc.qt.io/qt-5/android-openssl-support.html
Comment 1 Urs Fleisch 2021-12-25 11:52:54 UTC
Git commit 014846bea1ac7b3b0434ee7273aec0d6c5922d06 by Urs Fleisch.
Committed on 25/12/2021 at 09:26.
Pushed by ufleisch into branch 'master'.

Fix OpenSSL library suffix on Android

See https://doc.qt.io/qt-5/android-openssl-support.html

M  +1    -1    android/CMakeLists.txt
M  +4    -2    build.sh

https://invent.kde.org/multimedia/kid3/commit/014846bea1ac7b3b0434ee7273aec0d6c5922d06
Comment 2 Urs Fleisch 2021-12-25 12:02:46 UTC
This is now fixed in the development snapshot available in https://sourceforge.net/projects/kid3/files/kid3/development/.