mirror of
https://github.com/zealdocs/zeal.git
synced 2024-09-11 14:25:52 +03:00
feat(core): add option to ignore SSL errors (#1521)
This commit is contained in:
parent
94247fd4d0
commit
9eb6169073
@ -66,6 +66,14 @@ Application::Application(QObject *parent)
|
|||||||
m_fileManager = new FileManager(this);
|
m_fileManager = new FileManager(this);
|
||||||
m_httpServer = new HttpServer(this);
|
m_httpServer = new HttpServer(this);
|
||||||
|
|
||||||
|
connect(m_networkManager, &QNetworkAccessManager::sslErrors, this, [this](QNetworkReply *reply, const QList<QSslError> &errors)
|
||||||
|
{
|
||||||
|
if (m_settings->isIgnoreSSLErrorsEnabled) {
|
||||||
|
// Ignore all SSL errors
|
||||||
|
reply->ignoreSslErrors();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Extractor setup
|
// Extractor setup
|
||||||
m_extractorThread = new QThread(this);
|
m_extractorThread = new QThread(this);
|
||||||
m_extractor = new Extractor();
|
m_extractor = new Extractor();
|
||||||
@ -271,11 +279,13 @@ void Application::applySettings()
|
|||||||
|
|
||||||
QNetworkProxy::setApplicationProxy(proxy);
|
QNetworkProxy::setApplicationProxy(proxy);
|
||||||
|
|
||||||
// Force NM to pick up changes.
|
|
||||||
m_networkManager->clearAccessCache();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force NM to pick up changes.
|
||||||
|
m_networkManager->clearAccessCache();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::userAgent()
|
QString Application::userAgent()
|
||||||
|
@ -181,6 +181,7 @@ void Settings::load()
|
|||||||
proxyAuthenticate = settings->value(QStringLiteral("authenticate"), false).toBool();
|
proxyAuthenticate = settings->value(QStringLiteral("authenticate"), false).toBool();
|
||||||
proxyUserName = settings->value(QStringLiteral("username")).toString();
|
proxyUserName = settings->value(QStringLiteral("username")).toString();
|
||||||
proxyPassword = settings->value(QStringLiteral("password")).toString();
|
proxyPassword = settings->value(QStringLiteral("password")).toString();
|
||||||
|
isIgnoreSSLErrorsEnabled = settings->value(QStringLiteral("ignore_ssl_errors"), false).toBool();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
settings->beginGroup(GroupDocsets);
|
settings->beginGroup(GroupDocsets);
|
||||||
@ -268,6 +269,7 @@ void Settings::save()
|
|||||||
settings->setValue(QStringLiteral("authenticate"), proxyAuthenticate);
|
settings->setValue(QStringLiteral("authenticate"), proxyAuthenticate);
|
||||||
settings->setValue(QStringLiteral("username"), proxyUserName);
|
settings->setValue(QStringLiteral("username"), proxyUserName);
|
||||||
settings->setValue(QStringLiteral("password"), proxyPassword);
|
settings->setValue(QStringLiteral("password"), proxyPassword);
|
||||||
|
settings->setValue(QStringLiteral("ignore_ssl_errors"), isIgnoreSSLErrorsEnabled);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
settings->beginGroup(GroupDocsets);
|
settings->beginGroup(GroupDocsets);
|
||||||
|
@ -99,6 +99,7 @@ public:
|
|||||||
Socks5 = 4
|
Socks5 = 4
|
||||||
};
|
};
|
||||||
Q_ENUM(ProxyType)
|
Q_ENUM(ProxyType)
|
||||||
|
bool isIgnoreSSLErrorsEnabled;
|
||||||
|
|
||||||
// Internal
|
// Internal
|
||||||
// --------
|
// --------
|
||||||
|
@ -675,6 +675,7 @@ bool DocsetsDialog::updatesAvailable() const
|
|||||||
QNetworkReply *DocsetsDialog::download(const QUrl &url)
|
QNetworkReply *DocsetsDialog::download(const QUrl &url)
|
||||||
{
|
{
|
||||||
QNetworkReply *reply = m_application->download(url);
|
QNetworkReply *reply = m_application->download(url);
|
||||||
|
|
||||||
connect(reply, &QNetworkReply::downloadProgress, this, &DocsetsDialog::downloadProgress);
|
connect(reply, &QNetworkReply::downloadProgress, this, &DocsetsDialog::downloadProgress);
|
||||||
connect(reply, &QNetworkReply::finished, this, &DocsetsDialog::downloadCompleted);
|
connect(reply, &QNetworkReply::finished, this, &DocsetsDialog::downloadCompleted);
|
||||||
m_replies.append(reply);
|
m_replies.append(reply);
|
||||||
|
@ -255,6 +255,8 @@ void SettingsDialog::loadSettings()
|
|||||||
ui->proxyRequiresAuthCheckBox->setChecked(settings->proxyAuthenticate);
|
ui->proxyRequiresAuthCheckBox->setChecked(settings->proxyAuthenticate);
|
||||||
ui->proxyUsernameEdit->setText(settings->proxyUserName);
|
ui->proxyUsernameEdit->setText(settings->proxyUserName);
|
||||||
ui->proxyPasswordEdit->setText(settings->proxyPassword);
|
ui->proxyPasswordEdit->setText(settings->proxyPassword);
|
||||||
|
|
||||||
|
ui->ignoreSSLErrorsCheckBox->setChecked(settings->isIgnoreSSLErrorsEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::saveSettings()
|
void SettingsDialog::saveSettings()
|
||||||
@ -330,5 +332,7 @@ void SettingsDialog::saveSettings()
|
|||||||
settings->proxyUserName = ui->proxyUsernameEdit->text();
|
settings->proxyUserName = ui->proxyUsernameEdit->text();
|
||||||
settings->proxyPassword = ui->proxyPasswordEdit->text();
|
settings->proxyPassword = ui->proxyPasswordEdit->text();
|
||||||
|
|
||||||
|
settings->isIgnoreSSLErrorsEnabled = ui->ignoreSSLErrorsCheckBox->isChecked();
|
||||||
|
|
||||||
settings->save();
|
settings->save();
|
||||||
}
|
}
|
||||||
|
@ -745,6 +745,22 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_8">
|
||||||
|
<property name="title">
|
||||||
|
<string>Security</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="ignoreSSLErrorsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore SSL errors</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user