1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-22 07:54:18 +01:00

clementine-tagreader: Fix addDefaultCaCertificates deprecation

QSslSocket::addDefaultCaCertificates is deprecated in 5.15. Use
QSslConfiguration default configuration instead.
This commit is contained in:
Jim Broadus 2021-04-21 21:22:32 -07:00 committed by John Maguire
parent 5f75bde396
commit 59f6d95b80

View File

@ -19,6 +19,7 @@
#include <QCoreApplication>
#include <QLocalSocket>
#include <QSslConfiguration>
#include <QSslSocket>
#include <QStringList>
#include <iostream>
@ -58,8 +59,15 @@ int main(int argc, char** argv) {
return 1;
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
// This method is marked deprecated in 5.15.
QSslSocket::addDefaultCaCertificates(
QSslCertificate::fromPath(":/certs/godaddy-root.pem", QSsl::Pem));
#else
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.addCaCertificates(":/certs/godaddy-root.pem", QSsl::Pem);
QSslConfiguration::setDefaultConfiguration(config);
#endif
TagReaderWorker worker(&socket);