Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/sslui.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 60 | if (remainingErrors.isEmpty()) { | |||
---|---|---|---|---|---|
61 | //qDebug() << "Error list empty after removing errors to be ignored. Continuing."; | 61 | //qDebug() << "Error list empty after removing errors to be ignored. Continuing."; | ||
62 | return true; | 62 | return true; | ||
63 | } | 63 | } | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | //### We don't ask to permanently reject the certificate | 66 | //### We don't ask to permanently reject the certificate | ||
67 | 67 | | |||
68 | QString message = i18n("The server failed the authenticity check (%1).\n\n", ud->host); | 68 | QString message = i18n("The server failed the authenticity check (%1).\n\n", ud->host); | ||
69 | foreach (const KSslError &err, ud->sslErrors) { | 69 | for (const KSslError &err : qAsConst(ud->sslErrors)) { | ||
70 | message.append(err.errorString() + QLatin1Char('\n')); | 70 | message.append(err.errorString() + QLatin1Char('\n')); | ||
71 | } | 71 | } | ||
72 | message = message.trimmed(); | 72 | message = message.trimmed(); | ||
73 | 73 | | |||
74 | int msgResult; | 74 | int msgResult; | ||
75 | do { | 75 | do { | ||
76 | msgResult = KMessageBox::warningYesNoCancel(nullptr, message, i18n("Server Authentication"), | 76 | msgResult = KMessageBox::warningYesNoCancel(nullptr, message, i18n("Server Authentication"), | ||
77 | KGuiItem(i18n("&Details"), QStringLiteral("help-about")), | 77 | KGuiItem(i18n("&Details"), QStringLiteral("help-about")), | ||
78 | KGuiItem(i18n("Co&ntinue"), QStringLiteral("arrow-right"))); | 78 | KGuiItem(i18n("Co&ntinue"), QStringLiteral("arrow-right"))); | ||
79 | if (msgResult == KMessageBox::Yes) { | 79 | if (msgResult == KMessageBox::Yes) { | ||
80 | //Details was chosen - show the certificate and error details | 80 | //Details was chosen - show the certificate and error details | ||
81 | 81 | | |||
82 | QList<QList<KSslError::Error> > meh; // parallel list to cert list :/ | 82 | QList<QList<KSslError::Error> > meh; // parallel list to cert list :/ | ||
83 | 83 | | |||
84 | meh.reserve(ud->certificateChain.size()); | 84 | meh.reserve(ud->certificateChain.size()); | ||
85 | foreach (const QSslCertificate &cert, ud->certificateChain) { | 85 | for (const QSslCertificate &cert : qAsConst(ud->certificateChain)) { | ||
86 | QList<KSslError::Error> errors; | 86 | QList<KSslError::Error> errors; | ||
87 | foreach (const KSslError &error, ud->sslErrors) { | 87 | for (const KSslError &error : qAsConst(ud->sslErrors)) { | ||
88 | if (error.certificate() == cert) { | 88 | if (error.certificate() == cert) { | ||
89 | // we keep only the error code enum here | 89 | // we keep only the error code enum here | ||
90 | errors.append(error.error()); | 90 | errors.append(error.error()); | ||
91 | } | 91 | } | ||
92 | } | 92 | } | ||
93 | meh.append(errors); | 93 | meh.append(errors); | ||
94 | } | 94 | } | ||
95 | 95 | | |||
Show All 40 Lines |