1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Revert "Add option to completely disable SSLv3"

This reverts commit a640948c3b.

QSsl::SecureProtocols is default value and it already
disables SSLv3 in Qt 5

Closes #1579
This commit is contained in:
David Rosca 2015-01-12 21:11:12 +01:00
parent 26ca447d91
commit 80dd3a8f85
5 changed files with 16 additions and 70 deletions

View File

@ -73,7 +73,6 @@ NetworkManager::NetworkManager(QObject* parent)
, m_adblockManager(0)
, m_ignoreAllWarnings(false)
, m_disableWeakCiphers(true)
, m_disableSSLv3(true)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authentication(QNetworkReply*,QAuthenticator*)));
connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthentication(QNetworkProxy,QAuthenticator*)));
@ -177,27 +176,6 @@ void NetworkManager::disableWeakCiphers(bool disable)
}
}
void NetworkManager::disableSSLv3(bool disable)
{
QSsl::SslProtocol tlsProtocol;
QSsl::SslProtocol defaultProtocol;
#if QT_VERSION < QT_VERSION_CHECK(4,8,0)
tlsProtocol = QSsl::TlsV1;
defaultProtocol = QSsl::SslV3;
#elif QT_VERSION < QT_VERSION_CHECK(5,0,0)
tlsProtocol = QSsl::TlsV1;
defaultProtocol = QSsl::TlsV1SslV3;
#else
tlsProtocol = QSsl::TlsV1_0;
defaultProtocol = QSsl::TlsV1SslV3;
#endif
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setProtocol(disable ? tlsProtocol : defaultProtocol);
QSslConfiguration::setDefaultConfiguration(config);
}
static inline uint qHash(const QSslCertificate &cert)
{
return qHash(cert.toPem());
@ -702,18 +680,6 @@ void NetworkManager::setDisableWeakCiphers(bool state)
Settings().setValue("SSL-Configuration/DisableWeakCiphers", m_disableWeakCiphers);
}
bool NetworkManager::isDisablingSSLv3() const
{
return m_disableSSLv3;
}
void NetworkManager::setDisableSSLv3(bool state)
{
m_disableSSLv3 = state;
disableSSLv3(m_disableSSLv3);
Settings().setValue("SSL-Configuration/DisableSSLv3", m_disableSSLv3);
}
NetworkProxyFactory* NetworkManager::proxyFactory() const
{
return m_proxyFactory;
@ -745,7 +711,9 @@ void NetworkManager::saveSettings()
settings.setValue("CACertPaths", m_certPaths);
settings.setValue("IgnoreAllSSLWarnings", m_ignoreAllWarnings);
settings.setValue("DisableWeakCiphers", m_disableWeakCiphers);
settings.setValue("DisableSSLv3", m_disableSSLv3);
settings.endGroup();
settings.beginGroup("Web-Browser-Settings");
settings.endGroup();
}
@ -756,11 +724,9 @@ void NetworkManager::loadCertificates()
m_certPaths = settings.value("CACertPaths", QStringList()).toStringList();
m_ignoreAllWarnings = settings.value("IgnoreAllSSLWarnings", false).toBool();
m_disableWeakCiphers = settings.value("DisableWeakCiphers", true).toBool();
m_disableSSLv3 = settings.value("DisableSSLv3", true).toBool();
settings.endGroup();
disableWeakCiphers(m_disableWeakCiphers);
disableSSLv3(m_disableSSLv3);
// CA Certificates
m_caCerts = QSslSocket::defaultCaCertificates();

View File

@ -55,9 +55,6 @@ public:
bool isDisablingWeakCiphers() const;
void setDisableWeakCiphers(bool state);
bool isDisablingSSLv3() const;
void setDisableSSLv3(bool state);
NetworkProxyFactory* proxyFactory() const;
bool registerSchemeHandler(const QString &scheme, SchemeHandler* handler);
@ -75,7 +72,6 @@ private slots:
private:
void disableWeakCiphers(bool disable);
void disableSSLv3(bool disable);
AdBlockManager* m_adblockManager;
NetworkProxyFactory* m_proxyFactory;
@ -90,7 +86,6 @@ private:
bool m_ignoreAllWarnings;
bool m_disableWeakCiphers;
bool m_disableSSLv3;
bool m_doNotTrack;
bool m_sendReferer;
};

View File

@ -52,13 +52,11 @@ SSLManager::SSLManager(QWidget* parent)
connect(ui->deletePath, SIGNAL(clicked()), this, SLOT(deletePath()));
connect(ui->ignoreAll, SIGNAL(clicked(bool)), this, SLOT(ignoreAll(bool)));
connect(ui->disableWeakCiphers, SIGNAL(clicked(bool)), this, SLOT(disableWeakCiphers(bool)));
connect(ui->disableSSLv3, SIGNAL(clicked(bool)), this, SLOT(disableSSLv3(bool)));
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
// Settings
ui->disableWeakCiphers->setChecked(mApp->networkManager()->isDisablingWeakCiphers());
ui->disableSSLv3->setChecked(mApp->networkManager()->isDisablingSSLv3());
ui->ignoreAll->setChecked(mApp->networkManager()->isIgnoringAllWarnings());
}
@ -202,11 +200,6 @@ void SSLManager::disableWeakCiphers(bool state)
mApp->networkManager()->setDisableWeakCiphers(state);
}
void SSLManager::disableSSLv3(bool state)
{
mApp->networkManager()->setDisableSSLv3(state);
}
void SSLManager::closeEvent(QCloseEvent* e)
{
QStringList paths;

View File

@ -44,7 +44,6 @@ private slots:
void deleteCertificate();
void ignoreAll(bool state);
void disableWeakCiphers(bool state);
void disableSSLv3(bool state);
void addPath();
void deletePath();

View File

@ -172,21 +172,7 @@
</item>
<item row="7" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="ignoreAll">
<property name="text">
<string>Ignore all SSL Warnings</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="disableWeakCiphers">
<property name="text">
<string>Disable weak ciphers</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="2" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;b&gt;NOTE:&lt;/b&gt; Setting this option is a high security risk!</string>
@ -196,7 +182,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="2" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -212,7 +198,7 @@
</property>
</spacer>
</item>
<item row="4" column="2">
<item row="2" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -225,10 +211,17 @@
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="disableSSLv3">
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="ignoreAll">
<property name="text">
<string>Disable SSLv3</string>
<string>Ignore all SSL Warnings</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="disableWeakCiphers">
<property name="text">
<string>Disable weak ciphers</string>
</property>
</widget>
</item>