QWebEngineCertificateError Class

The QWebEngineCertificateError class provides information about a certificate error. 更多...

头: #include <QWebEngineCertificateError>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
实例化: WebEngineCertificateError

公共类型

enum Type { SslPinnedKeyNotInCertificateChain, CertificateCommonNameInvalid, CertificateDateInvalid, CertificateAuthorityInvalid, CertificateContainsErrors, …, CertificateSymantecLegacy }

特性

公共函数

void acceptCertificate ()
QList<QSslCertificate> certificateChain () const
void defer ()
QString description () const
bool isOverridable () const
void rejectCertificate ()
QWebEngineCertificateError::Type type () const
QUrl url () const

详细描述

Provides information about a certificate error. This class is used as a parameter of QWebEnginePage::certificateError ().

成员类型文档编制

enum QWebEngineCertificateError:: Type

This enum describes the type of certificate error encountered.

The values of this enum type match the SSL errors Chromium provides. QSslError::SslError values are not used directly, because the Qt error categories cannot be mapped to the Chromium error categories.

常量 描述
QWebEngineCertificateError::SslPinnedKeyNotInCertificateChain -150 The certificate did not match the built-in public keys pinned for the host name.
QWebEngineCertificateError::CertificateCommonNameInvalid -200 The certificate's common name did not match the host name.
QWebEngineCertificateError::CertificateDateInvalid -201 The certificate is not valid at the current date and time.
QWebEngineCertificateError::CertificateAuthorityInvalid -202 The certificate is not signed by a trusted authority.
QWebEngineCertificateError::CertificateContainsErrors -203 The certificate contains errors.
QWebEngineCertificateError::CertificateNoRevocationMechanism -204 The certificate has no mechanism for determining if it has been revoked.
QWebEngineCertificateError::CertificateUnableToCheckRevocation -205 Revocation information for the certificate is not available.
QWebEngineCertificateError::CertificateRevoked -206 The certificate has been revoked.
QWebEngineCertificateError::CertificateInvalid -207 The certificate is invalid.
QWebEngineCertificateError::CertificateWeakSignatureAlgorithm -208 The certificate is signed using a weak signature algorithm.
QWebEngineCertificateError::CertificateNonUniqueName -210 The host name specified in the certificate is not unique.
QWebEngineCertificateError::CertificateWeakKey -211 The certificate contains a weak key.
QWebEngineCertificateError::CertificateNameConstraintViolation -212 The certificate claimed DNS names that are in violation of name constraints.
QWebEngineCertificateError::CertificateValidityTooLong -213 The certificate has a validity period that is too long. (Added in Qt 5.7)
QWebEngineCertificateError::CertificateTransparencyRequired -214 Certificate Transparency was required for this connection, but the server did not provide CT information that complied with the policy. (Added in Qt 5.8)
QWebEngineCertificateError::CertificateKnownInterceptionBlocked -217 The certificate is known to be used for interception by an entity other the device owner. (Added in 5.15)
QWebEngineCertificateError::SslObsoleteVersion -218 The connection uses an obsolete version of SSL/TLS. (Added in Qt 6.2, deprecated in Qt 6.4)
QWebEngineCertificateError::CertificateSymantecLegacy -215 The certificate is a legacy Symantec one that's no longer valid. (Added in Qt 6.2)

特性文档编制

[read-only] overridable : const bool

This property holds whether this error can be overridden and accepted.

访问函数:

bool isOverridable () const

另请参阅 description ().

成员函数文档编制

[invokable] void QWebEngineCertificateError:: acceptCertificate ()

Accepts the certificate and continues the loading of the requested URL.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

QList < QSslCertificate > QWebEngineCertificateError:: certificateChain () const

Returns the peer's chain of digital certificates.

Chain starts with the peer's immediate certificate and ending with the CA's certificate.

[invokable] void QWebEngineCertificateError:: defer ()

Marks the certificate error for delayed handling.

This function should be called when there is a need to postpone the decision whether to accept a certificate, for example, while waiting for user input. When called, the function pauses the URL request until acceptCertificate () 或 rejectCertificate () 被调用。

注意: It is only possible to defer overridable certificate errors.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

另请参阅 isOverridable ().

QString QWebEngineCertificateError:: description () const

Returns a short localized human-readable description of the error.

注意: Getter function for property description.

另请参阅 url () 和 isOverridable ().

[invokable] void QWebEngineCertificateError:: rejectCertificate ()

Rejects the certificate and aborts the loading of the requested URL.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

QWebEngineCertificateError::Type QWebEngineCertificateError:: type () const

Returns the type of the error.

注意: getter 函数对于特性 type。

另请参阅 description () 和 isOverridable ().

QUrl QWebEngineCertificateError:: url () const

Returns the URL that triggered the error.

注意: Getter function for property url.

另请参阅 description ().