diff --git a/src/base/net/downloadmanager.cpp b/src/base/net/downloadmanager.cpp index ffadffedc..2c58f96fc 100644 --- a/src/base/net/downloadmanager.cpp +++ b/src/base/net/downloadmanager.cpp @@ -122,7 +122,17 @@ Net::DownloadManager::DownloadManager(QObject *parent) , m_networkManager {new QNetworkAccessManager(this)} { m_networkManager->setCookieJar(m_networkCookieJar); - connect(m_networkManager, &QNetworkAccessManager::sslErrors, this, &Net::DownloadManager::ignoreSslErrors); + connect(m_networkManager, &QNetworkAccessManager::sslErrors, this + , [](QNetworkReply *reply, const QList &errors) + { + QStringList errorList; + for (const QSslError &error : errors) + errorList += error.errorString(); + LogMsg(tr("Ignoring SSL error, URL: \"%1\", errors: \"%2\"").arg(reply->url().toString(), errorList.join(u". ")), Log::WARNING); + + // Ignore all SSL errors + reply->ignoreSslErrors(); + }); connect(ProxyConfigurationManager::instance(), &ProxyConfigurationManager::proxyConfigurationChanged , this, &DownloadManager::applyProxySettings); @@ -304,17 +314,6 @@ void Net::DownloadManager::processRequest(DownloadHandlerImpl *downloadHandler) downloadHandler->assignNetworkReply(m_networkManager->get(request)); } -void Net::DownloadManager::ignoreSslErrors(QNetworkReply *reply, const QList &errors) -{ - QStringList errorList; - for (const QSslError &error : errors) - errorList += error.errorString(); - LogMsg(tr("Ignoring SSL error, URL: \"%1\", errors: \"%2\"").arg(reply->url().toString(), errorList.join(u". ")), Log::WARNING); - - // Ignore all SSL errors - reply->ignoreSslErrors(); -} - Net::DownloadRequest::DownloadRequest(const QString &url) : m_url {url} { diff --git a/src/base/net/downloadmanager.h b/src/base/net/downloadmanager.h index c56755794..19c2ce085 100644 --- a/src/base/net/downloadmanager.h +++ b/src/base/net/downloadmanager.h @@ -151,9 +151,6 @@ namespace Net static bool hasSupportedScheme(const QString &url); - private slots: - void ignoreSslErrors(QNetworkReply *, const QList &); - private: class NetworkCookieJar;