Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-12-08 14:30:15 +0300
committerOlivier Goffart <ogoffart@woboq.com>2017-12-08 18:16:02 +0300
commit71dcf7fc37d4b8b32dcf37d0a2cf8653dd2d589c (patch)
tree199a296c86ef41176002cdb954d16a1a96d56657 /src/gui/sslbutton.cpp
parent0a59faf03d94ae04b6a51594f2f5c1bbb1894767 (diff)
SSLButton: Removes some call to deprecated functions
Diffstat (limited to 'src/gui/sslbutton.cpp')
-rw-r--r--src/gui/sslbutton.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/gui/sslbutton.cpp b/src/gui/sslbutton.cpp
index b1a16317c..e387f885e 100644
--- a/src/gui/sslbutton.cpp
+++ b/src/gui/sslbutton.cpp
@@ -39,21 +39,6 @@ SslButton::SslButton(QWidget *parent)
this, &SslButton::slotUpdateMenu);
}
-QString SslButton::protoToString(QSsl::SslProtocol proto)
-{
- switch (proto) {
- break;
- case QSsl::SslV2:
- return QLatin1String("SSL v2");
- case QSsl::SslV3:
- return QLatin1String("SSL v3");
- case QSsl::TlsV1:
- return QLatin1String("TLS");
- default:
- return QString();
- }
-}
-
static QString addCertDetailsField(const QString &key, const QString &value)
{
if (value.isEmpty())
@@ -92,7 +77,7 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert,
QString serial = QString::fromUtf8(cert.serialNumber());
QString effectiveDate = cert.effectiveDate().date().toString();
QString expiryDate = cert.expiryDate().date().toString();
- QString sna = QStringList(cert.alternateSubjectNames().values()).join(" ");
+ QString sna = QStringList(cert.subjectAlternativeNames().values()).join(" ");
QString details;
QTextStream stream(&details);
@@ -144,7 +129,7 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert,
QString certId = cn.isEmpty() ? ou : cn;
- if (QSslSocket::systemCaCertificates().contains(cert)) {
+ if (QSslConfiguration::systemCaCertificates().contains(cert)) {
txt += certId;
} else {
if (isSelfSigned(cert)) {
@@ -224,16 +209,18 @@ void SslButton::slotUpdateMenu()
_menu->addAction(tr("Certificate information:"))->setEnabled(false);
+ const auto systemCerts = QSslConfiguration::systemCaCertificates();
+
QList<QSslCertificate> tmpChain;
foreach (QSslCertificate cert, chain) {
tmpChain << cert;
- if (QSslSocket::systemCaCertificates().contains(cert))
+ if (systemCerts.contains(cert))
break;
}
chain = tmpChain;
// find trust anchor (informational only, verification is done by QSslSocket!)
- foreach (QSslCertificate rootCA, QSslSocket::systemCaCertificates()) {
+ for (const QSslCertificate &rootCA : systemCerts) {
if (rootCA.issuerInfo(QSslCertificate::CommonName) == chain.last().issuerInfo(QSslCertificate::CommonName)
&& rootCA.issuerInfo(QSslCertificate::Organization) == chain.last().issuerInfo(QSslCertificate::Organization)) {
chain.append(rootCA);