mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Replace deprecated QSslSocket::setDefaultCiphers()
This commit is contained in:
parent
168d3fbdac
commit
c657134344
1 changed files with 6 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include <QMutableListIterator>
|
#include <QMutableListIterator>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
#include <QSslCipher>
|
#include <QSslCipher>
|
||||||
|
#include <QSslConfiguration>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -51,7 +52,7 @@ namespace
|
||||||
QList<QSslCipher> safeCipherList()
|
QList<QSslCipher> safeCipherList()
|
||||||
{
|
{
|
||||||
const QStringList badCiphers {"idea", "rc4"};
|
const QStringList badCiphers {"idea", "rc4"};
|
||||||
const QList<QSslCipher> allCiphers {QSslSocket::supportedCiphers()};
|
const QList<QSslCipher> allCiphers {QSslConfiguration::supportedCiphers()};
|
||||||
QList<QSslCipher> safeCiphers;
|
QList<QSslCipher> safeCiphers;
|
||||||
std::copy_if(allCiphers.cbegin(), allCiphers.cend(), std::back_inserter(safeCiphers), [&badCiphers](const QSslCipher &cipher)
|
std::copy_if(allCiphers.cbegin(), allCiphers.cend(), std::back_inserter(safeCiphers), [&badCiphers](const QSslCipher &cipher)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +73,10 @@ Server::Server(IRequestHandler *requestHandler, QObject *parent)
|
||||||
, m_https(false)
|
, m_https(false)
|
||||||
{
|
{
|
||||||
setProxy(QNetworkProxy::NoProxy);
|
setProxy(QNetworkProxy::NoProxy);
|
||||||
QSslSocket::setDefaultCiphers(safeCipherList());
|
|
||||||
|
QSslConfiguration sslConf {QSslConfiguration::defaultConfiguration()};
|
||||||
|
sslConf.setCiphers(safeCipherList());
|
||||||
|
QSslConfiguration::setDefaultConfiguration(sslConf);
|
||||||
|
|
||||||
auto *dropConnectionTimer = new QTimer(this);
|
auto *dropConnectionTimer = new QTimer(this);
|
||||||
connect(dropConnectionTimer, &QTimer::timeout, this, &Server::dropTimedOutConnection);
|
connect(dropConnectionTimer, &QTimer::timeout, this, &Server::dropTimedOutConnection);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue