Fix loading certificates on Android with OpenSSL

Fixes: QTBUG-96606
Change-Id: Ic2a55fa65c5dc3c057a4da25c218af5a9861410e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 504df6b135d4ac17aa2290e1aa943d216fb7ef55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2021-09-20 20:05:30 +02:00 committed by Qt Cherry-pick Bot
parent f92df090f5
commit 604e4a8e7c

View File

@ -361,7 +361,6 @@ QTlsPrivate::X509Certificate *QTlsBackendOpenSSL::createCertificate() const
namespace QTlsPrivate {
// TLSTODO: remove.
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
QList<QByteArray> fetchSslCertificateData();
#endif
@ -392,6 +391,10 @@ QList<QSslCertificate> systemCaCertificates()
}
CertCloseStore(hSystemStore, 0);
}
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
const QList<QByteArray> certData = fetchSslCertificateData();
for (auto certDatum : certData)
systemCerts.append(QSslCertificate::fromData(certDatum, QSsl::Der));
#elif defined(Q_OS_UNIX)
QSet<QString> certFiles;
QDir currentDir;