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

[NetworkManager] Use list of old servers that doesn't understand TLSv1 handshake

Force SslV3 for those old servers.

Closes #1176
Closes #1141
Closes #1080
This commit is contained in:
nowrep 2014-02-01 20:58:20 +01:00
parent 260447e414
commit ee91727cb2
2 changed files with 16 additions and 0 deletions

View File

@ -84,6 +84,9 @@ NetworkManager::NetworkManager(QObject* parent)
m_proxyFactory = new NetworkProxyFactory();
setProxyFactory(m_proxyFactory);
loadSettings();
m_sslv3Sites << QLatin1String("centrum.sk") << QLatin1String("oneaccount.com") << QLatin1String("www.hdi.de")
<< QLatin1String("live.com");
}
void NetworkManager::loadSettings()
@ -571,6 +574,18 @@ QNetworkReply* NetworkManager::createRequest(QNetworkAccessManager::Operation op
}
}
// Force SSLv3 for servers that doesn't understand TLSv1 handshake
if (req.url().scheme() == QLatin1String("https")) {
foreach (const QString &host, m_sslv3Sites) {
if (req.url().host().endsWith(host)) {
QSslConfiguration conf = req.sslConfiguration();
conf.setProtocol(QSsl::SslV3);
req.setSslConfiguration(conf);
break;
}
}
}
return QNetworkAccessManager::createRequest(op, req, outgoingData);
}

View File

@ -73,6 +73,7 @@ private:
AdBlockManager* m_adblockManager;
NetworkProxyFactory* m_proxyFactory;
QStringList m_sslv3Sites;
QStringList m_certPaths;
QList<QSslCertificate> m_caCerts;
QList<QSslCertificate> m_localCerts;