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:
parent
f92df090f5
commit
604e4a8e7c
@ -361,7 +361,6 @@ QTlsPrivate::X509Certificate *QTlsBackendOpenSSL::createCertificate() const
|
|||||||
|
|
||||||
namespace QTlsPrivate {
|
namespace QTlsPrivate {
|
||||||
|
|
||||||
// TLSTODO: remove.
|
|
||||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||||
QList<QByteArray> fetchSslCertificateData();
|
QList<QByteArray> fetchSslCertificateData();
|
||||||
#endif
|
#endif
|
||||||
@ -392,6 +391,10 @@ QList<QSslCertificate> systemCaCertificates()
|
|||||||
}
|
}
|
||||||
CertCloseStore(hSystemStore, 0);
|
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)
|
#elif defined(Q_OS_UNIX)
|
||||||
QSet<QString> certFiles;
|
QSet<QString> certFiles;
|
||||||
QDir currentDir;
|
QDir currentDir;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user