diff --git a/src/core/ksslcertificatemanager.h b/src/core/ksslcertificatemanager.h --- a/src/core/ksslcertificatemanager.h +++ b/src/core/ksslcertificatemanager.h @@ -109,9 +109,9 @@ QList caCertificates() const; /** @deprecated since 5.64, use the corresponding QSslError variant. */ - static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &); + static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &errors); /** @deprecated since 5.64, use the corresponding QSslError variant. */ - static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &); + static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &errors); /** * Returns the subset of @p errors that cannot be ignored, ie. that is considered fatal. * @since 5.64 diff --git a/src/core/ksslcertificatemanager.cpp b/src/core/ksslcertificatemanager.cpp --- a/src/core/ksslcertificatemanager.cpp +++ b/src/core/ksslcertificatemanager.cpp @@ -506,25 +506,34 @@ } //static -QList KSslCertificateManager::nonIgnorableErrors(const QList &/*e*/) +QList KSslCertificateManager::nonIgnorableErrors(const QList &errors) { QList ret; - // ### add filtering here... + // errors not handled in KSSLD + std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const KSslError &e) { + return e.error() == KSslError::NoPeerCertificate || e.error() == KSslError::PathLengthExceeded; + }); return ret; } //static -QList KSslCertificateManager::nonIgnorableErrors(const QList &/*e*/) +QList KSslCertificateManager::nonIgnorableErrors(const QList &errors) { QList ret; - // ### add filtering here... + // errors not handled in KSSLD + std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const KSslError::Error &e) { + return e == KSslError::NoPeerCertificate || e == KSslError::PathLengthExceeded; + }); return ret; } QList KSslCertificateManager::nonIgnorableErrors(const QList &errors) { - Q_UNUSED(errors) - // ### add filtering here... + QList ret; + // errors not handled in KSSLD + std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const QSslError &e) { + return e.error() == QSslError::NoPeerCertificate || e.error() == QSslError::PathLengthExceeded || e.error() == QSslError::NoSslSupport; + }); return {}; }