Merge #16708: qt: Replace obsolete functions of QSslSocket

2e1455c4a100170c322165af3ecbbcd3004b2f9d Replace obsolete functions of QSslSocket (Hennadii Stepanov)

Pull request description:

  The [`QSslSocket::setDefaultCaCertificates()`](https://doc.qt.io/qt-5/qsslsocket-obsolete.html#setDefaultCaCertificates) and [`QSslSocket::systemCaCertificates()`](https://doc.qt.io/qt-5/qsslsocket-obsolete.html#systemCaCertificates) member functions are [obsolete](https://doc.qt.io/qt-5.12/qsslsocket-obsolete.html) since Qt 5.12.

  This PR replaces them, does not change behavior and keeps compatibility with [Qt 5.5.1](https://github.com/bitcoin/bitcoin/pull/15393).

ACKs for top commit:
  laanwj:
    ACK 2e1455c4a100170c322165af3ecbbcd3004b2f9d
  promag:
    ACK 2e1455c4a100170c322165af3ecbbcd3004b2f9d.

Tree-SHA512: 4182cd22a3e7a998d62a0fe84e748803a6962a65920b74da9fcf5666a700507468bb6e428054ccb70c2fbb7969a56933f450bc405c7a32ecbc1f8af4c1f983a3
This commit is contained in:
Wladimir J. van der Laan 2019-08-29 13:09:31 +02:00 committed by Pasta
parent dfea329f69
commit 54bfed144f
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -42,8 +42,8 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSslCertificate>
#include <QSslConfiguration>
#include <QSslError>
#include <QSslSocket>
#include <QStringList>
#include <QTextDocument>
#include <QUrlQuery>
@ -453,9 +453,9 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
certList = QSslCertificate::fromPath(certFile);
// Use those certificates when fetching payment requests, too:
QSslSocket::setDefaultCaCertificates(certList);
QSslConfiguration::defaultConfiguration().setCaCertificates(certList);
} else
certList = QSslSocket::systemCaCertificates();
certList = QSslConfiguration::systemCaCertificates();
int nRootCerts = 0;
const QDateTime currentTime = QDateTime::currentDateTime();