mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-30 12:42:25 -04:00
Ignore SSL certifcate errors on Android
This commit is contained in:
parent
95cb214b57
commit
eb9fb3469d
@ -73,7 +73,20 @@ QString HttpDownloadManager::downloadDir()
|
|||||||
void HttpDownloadManager::sslErrors(const QList<QSslError> &sslErrors)
|
void HttpDownloadManager::sslErrors(const QList<QSslError> &sslErrors)
|
||||||
{
|
{
|
||||||
for (const QSslError &error : 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)
|
bool HttpDownloadManager::isHttpRedirect(QNetworkReply *reply)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user