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

[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
This commit is contained in:
nowrep 2014-02-13 20:46:15 +01:00
parent d005505dba
commit 9ae0352548
4 changed files with 16 additions and 8 deletions

View File

@ -916,7 +916,7 @@ void MainApplication::saveSettings()
} }
m_searchEnginesManager->saveSettings(); m_searchEnginesManager->saveSettings();
m_networkmanager->saveCertificates(); m_networkmanager->saveSettings();
m_plugins->shutdown(); m_plugins->shutdown();
qIconProvider->saveIconsToDatabase(); qIconProvider->saveIconsToDatabase();
clearTempPath(); clearTempPath();

View File

@ -85,10 +85,6 @@ NetworkManager::NetworkManager(QObject* parent)
setProxyFactory(m_proxyFactory); setProxyFactory(m_proxyFactory);
loadSettings(); 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() void NetworkManager::loadSettings()
@ -101,12 +97,20 @@ void NetworkManager::loadSettings()
setCache(cache); 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"); settings.beginGroup("Web-Browser-Settings");
m_doNotTrack = settings.value("DoNotTrack", false).toBool(); m_doNotTrack = settings.value("DoNotTrack", false).toBool();
m_sendReferer = settings.value("SendReferer", true).toBool(); m_sendReferer = settings.value("SendReferer", true).toBool();
m_sslv3Sites = settings.value("SSLv3Sites", sslv3Sites).toStringList();
settings.endGroup(); settings.endGroup();
m_acceptLanguage = AcceptLanguage::generateHeader(settings.value("Language/acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList()); m_acceptLanguage = AcceptLanguage::generateHeader(settings.value("Language/acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList());
#if defined(Q_OS_WIN) || defined(Q_OS_HAIKU) || defined(Q_OS_OS2) #if defined(Q_OS_WIN) || defined(Q_OS_HAIKU) || defined(Q_OS_OS2)
QString certDir = mApp->PROFILEDIR + "certificates"; QString certDir = mApp->PROFILEDIR + "certificates";
QString bundlePath = certDir + "/ca-bundle.crt"; QString bundlePath = certDir + "/ca-bundle.crt";
@ -676,13 +680,17 @@ bool NetworkManager::unregisterSchemeHandler(const QString &scheme, SchemeHandle
return m_schemeHandlers.remove(scheme) == 1; return m_schemeHandlers.remove(scheme) == 1;
} }
void NetworkManager::saveCertificates() void NetworkManager::saveSettings()
{ {
Settings settings; Settings settings;
settings.beginGroup("SSL-Configuration"); settings.beginGroup("SSL-Configuration");
settings.setValue("CACertPaths", m_certPaths); settings.setValue("CACertPaths", m_certPaths);
settings.setValue("IgnoreAllSSLWarnings", m_ignoreAllWarnings); settings.setValue("IgnoreAllSSLWarnings", m_ignoreAllWarnings);
settings.endGroup(); settings.endGroup();
settings.beginGroup("Web-Browser-Settings");
settings.setValue("SSLv3Sites", m_sslv3Sites);
settings.endGroup();
} }
void NetworkManager::loadCertificates() void NetworkManager::loadCertificates()

View File

@ -37,7 +37,7 @@ public:
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData); QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData);
void loadSettings(); void loadSettings();
void saveCertificates(); void saveSettings();
void loadCertificates(); void loadCertificates();
QList<QSslCertificate> getCaCertificates() { return m_caCerts; } QList<QSslCertificate> getCaCertificates() { return m_caCerts; }

View File

@ -204,7 +204,7 @@ void SSLManager::closeEvent(QCloseEvent* e)
} }
mApp->networkManager()->setCertificatePaths(paths); mApp->networkManager()->setCertificatePaths(paths);
mApp->networkManager()->saveCertificates(); mApp->networkManager()->saveSettings();
QWidget::closeEvent(e); QWidget::closeEvent(e);
} }