Merge #16708: qt: Replace obsolete functions of QSslSocket

2e1455c4a1 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 2e1455c4a1
  promag:
    ACK 2e1455c4a1.

Tree-SHA512: 4182cd22a3e7a998d62a0fe84e748803a6962a65920b74da9fcf5666a700507468bb6e428054ccb70c2fbb7969a56933f450bc405c7a32ecbc1f8af4c1f983a3
This commit is contained in:
Wladimir J. van der Laan 2019-08-29 13:09:31 +02:00
commit aca76b9ee8
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -41,8 +41,8 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSslCertificate>
#include <QSslConfiguration>
#include <QSslError>
#include <QSslSocket>
#include <QStringList>
#include <QTextDocument>
#include <QUrlQuery>
@ -448,9 +448,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();