mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Merge pull request #21364 from sledgehammer999/dont_ignore_ssl_errors
Don't ignore SSL errors
This commit is contained in:
@@ -148,10 +148,20 @@ Net::DownloadManager::DownloadManager(QObject *parent)
|
||||
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();
|
||||
QString errorMsg;
|
||||
if (!Preferences::instance()->isIgnoreSSLErrors())
|
||||
{
|
||||
errorMsg = tr("SSL error, URL: \"%1\", errors: \"%2\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMsg = tr("Ignoring SSL error, URL: \"%1\", errors: \"%2\"");
|
||||
// Ignore all SSL errors
|
||||
reply->ignoreSslErrors();
|
||||
}
|
||||
|
||||
LogMsg(errorMsg.arg(reply->url().toString(), errorList.join(u". ")), Log::WARNING);
|
||||
});
|
||||
|
||||
connect(ProxyConfigurationManager::instance(), &ProxyConfigurationManager::proxyConfigurationChanged
|
||||
|
||||
@@ -1343,6 +1343,19 @@ void Preferences::setMarkOfTheWebEnabled(const bool enabled)
|
||||
setValue(u"Preferences/Advanced/markOfTheWeb"_s, enabled);
|
||||
}
|
||||
|
||||
bool Preferences::isIgnoreSSLErrors() const
|
||||
{
|
||||
return value(u"Preferences/Advanced/IgnoreSSLErrors"_s, false);
|
||||
}
|
||||
|
||||
void Preferences::setIgnoreSSLErrors(const bool enabled)
|
||||
{
|
||||
if (enabled == isIgnoreSSLErrors())
|
||||
return;
|
||||
|
||||
setValue(u"Preferences/Advanced/IgnoreSSLErrors"_s, enabled);
|
||||
}
|
||||
|
||||
Path Preferences::getPythonExecutablePath() const
|
||||
{
|
||||
return value(u"Preferences/Search/pythonExecutablePath"_s, Path());
|
||||
|
||||
@@ -295,6 +295,8 @@ public:
|
||||
void setTrackerPortForwardingEnabled(bool enabled);
|
||||
bool isMarkOfTheWebEnabled() const;
|
||||
void setMarkOfTheWebEnabled(bool enabled);
|
||||
bool isIgnoreSSLErrors() const;
|
||||
void setIgnoreSSLErrors(bool enabled);
|
||||
Path getPythonExecutablePath() const;
|
||||
void setPythonExecutablePath(const Path &path);
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
|
||||
Reference in New Issue
Block a user