From 9ae0352548efd2a25e3abb787ba07cfac8552fb6 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 13 Feb 2014 20:46:15 +0100 Subject: [PATCH] [SslV3Sites] Added possibility to change list of sites in settings.ini In settings.ini: Web-Browser-Settings/SSLv3Sites Also added sermapa.es to default list --- src/lib/app/mainapplication.cpp | 2 +- src/lib/network/networkmanager.cpp | 18 +++++++++++++----- src/lib/network/networkmanager.h | 2 +- src/lib/preferences/sslmanager.cpp | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 1dd939473..4958dd51d 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -916,7 +916,7 @@ void MainApplication::saveSettings() } m_searchEnginesManager->saveSettings(); - m_networkmanager->saveCertificates(); + m_networkmanager->saveSettings(); m_plugins->shutdown(); qIconProvider->saveIconsToDatabase(); clearTempPath(); diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index 319c02230..b2ccfe385 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -85,10 +85,6 @@ NetworkManager::NetworkManager(QObject* parent) setProxyFactory(m_proxyFactory); loadSettings(); - // Force SSLv3 for servers that doesn't understand TLSv1 handshake - m_sslv3Sites << QLatin1String("centrum.sk") << QLatin1String("centrum.cz") << QLatin1String("oneaccount.com") << QLatin1String("hdi.de") - << QLatin1String("live.com") << QLatin1String("i0.cz"); - } void NetworkManager::loadSettings() @@ -101,12 +97,20 @@ void NetworkManager::loadSettings() setCache(cache); } + // Force SSLv3 for servers that doesn't understand TLSv1 handshake + QStringList sslv3Sites; + sslv3Sites << QLatin1String("centrum.sk") << QLatin1String("centrum.cz") << QLatin1String("oneaccount.com") << QLatin1String("hdi.de") + << QLatin1String("live.com") << QLatin1String("i0.cz") << QLatin1String("sermepa.es"); + settings.beginGroup("Web-Browser-Settings"); m_doNotTrack = settings.value("DoNotTrack", false).toBool(); m_sendReferer = settings.value("SendReferer", true).toBool(); + m_sslv3Sites = settings.value("SSLv3Sites", sslv3Sites).toStringList(); settings.endGroup(); + m_acceptLanguage = AcceptLanguage::generateHeader(settings.value("Language/acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList()); + #if defined(Q_OS_WIN) || defined(Q_OS_HAIKU) || defined(Q_OS_OS2) QString certDir = mApp->PROFILEDIR + "certificates"; QString bundlePath = certDir + "/ca-bundle.crt"; @@ -676,13 +680,17 @@ bool NetworkManager::unregisterSchemeHandler(const QString &scheme, SchemeHandle return m_schemeHandlers.remove(scheme) == 1; } -void NetworkManager::saveCertificates() +void NetworkManager::saveSettings() { Settings settings; settings.beginGroup("SSL-Configuration"); settings.setValue("CACertPaths", m_certPaths); settings.setValue("IgnoreAllSSLWarnings", m_ignoreAllWarnings); settings.endGroup(); + + settings.beginGroup("Web-Browser-Settings"); + settings.setValue("SSLv3Sites", m_sslv3Sites); + settings.endGroup(); } void NetworkManager::loadCertificates() diff --git a/src/lib/network/networkmanager.h b/src/lib/network/networkmanager.h index a1723a469..099abd533 100644 --- a/src/lib/network/networkmanager.h +++ b/src/lib/network/networkmanager.h @@ -37,7 +37,7 @@ public: QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData); void loadSettings(); - void saveCertificates(); + void saveSettings(); void loadCertificates(); QList getCaCertificates() { return m_caCerts; } diff --git a/src/lib/preferences/sslmanager.cpp b/src/lib/preferences/sslmanager.cpp index f2e1139ae..5811518fb 100644 --- a/src/lib/preferences/sslmanager.cpp +++ b/src/lib/preferences/sslmanager.cpp @@ -204,7 +204,7 @@ void SSLManager::closeEvent(QCloseEvent* e) } mApp->networkManager()->setCertificatePaths(paths); - mApp->networkManager()->saveCertificates(); + mApp->networkManager()->saveSettings(); QWidget::closeEvent(e); }