mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
parent
c51aa2d573
commit
37c04fdeed
@ -122,7 +122,17 @@ Net::DownloadManager::DownloadManager(QObject *parent)
|
|||||||
, m_networkManager {new QNetworkAccessManager(this)}
|
, m_networkManager {new QNetworkAccessManager(this)}
|
||||||
{
|
{
|
||||||
m_networkManager->setCookieJar(m_networkCookieJar);
|
m_networkManager->setCookieJar(m_networkCookieJar);
|
||||||
connect(m_networkManager, &QNetworkAccessManager::sslErrors, this, &Net::DownloadManager::ignoreSslErrors);
|
connect(m_networkManager, &QNetworkAccessManager::sslErrors, this
|
||||||
|
, [](QNetworkReply *reply, const QList<QSslError> &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
|
connect(ProxyConfigurationManager::instance(), &ProxyConfigurationManager::proxyConfigurationChanged
|
||||||
, this, &DownloadManager::applyProxySettings);
|
, this, &DownloadManager::applyProxySettings);
|
||||||
@ -304,17 +314,6 @@ void Net::DownloadManager::processRequest(DownloadHandlerImpl *downloadHandler)
|
|||||||
downloadHandler->assignNetworkReply(m_networkManager->get(request));
|
downloadHandler->assignNetworkReply(m_networkManager->get(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Net::DownloadManager::ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &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)
|
Net::DownloadRequest::DownloadRequest(const QString &url)
|
||||||
: m_url {url}
|
: m_url {url}
|
||||||
{
|
{
|
||||||
|
@ -151,9 +151,6 @@ namespace Net
|
|||||||
|
|
||||||
static bool hasSupportedScheme(const QString &url);
|
static bool hasSupportedScheme(const QString &url);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void ignoreSslErrors(QNetworkReply *, const QList<QSslError> &);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class NetworkCookieJar;
|
class NetworkCookieJar;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user