1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-07-28 11:42:25 -04:00

Ignore SSL certifcate errors on Android

This commit is contained in:
Jon Beniston 2023-01-02 15:23:41 +00:00
parent 95cb214b57
commit eb9fb3469d

View File

@ -73,7 +73,20 @@ QString HttpDownloadManager::downloadDir()
void HttpDownloadManager::sslErrors(const QList<QSslError> &sslErrors)
{
for (const QSslError &error : sslErrors)
qCritical() << "HttpDownloadManager: SSL error: " << error.errorString();
{
qCritical() << "HttpDownloadManager: SSL error" << (int)error.error() << ": " << error.errorString();
#ifdef ANDROID
// On Android 6 (but not on 12), we always seem to get: "The issuer certificate of a locally looked up certificate could not be found"
// which causes downloads to fail, so ignore
if (error.error() == QSslError::UnableToGetLocalIssuerCertificate)
{
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
QList<QSslError> errorsThatCanBeIgnored;
errorsThatCanBeIgnored << QSslError(QSslError::UnableToGetLocalIssuerCertificate, error.certificate());
reply->ignoreSslErrors(errorsThatCanBeIgnored);
}
#endif
}
}
bool HttpDownloadManager::isHttpRedirect(QNetworkReply *reply)