QSslError Class
QSslError 类提供了一个 SSL 错误。更多内容...
| 头文件: | #include <QSslError> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
- 所有成员的列表,包括继承的成员
- QSslError 属于“网络编程 API”和“隐式共享类”。
注意:该类中的所有函数均为可重入函数。
公共类型
| enum | SslError { NoError, UnableToGetIssuerCertificate, UnableToDecryptCertificateSignature, UnableToDecodeIssuerPublicKey, CertificateSignatureFailed, …, OcspStatusUnknown } |
公共函数
| QSslError() | |
| QSslError(QSslError::SslError error) | |
| QSslError(QSslError::SslError error, const QSslCertificate &certificate) | |
| QSslError(const QSslError &other) | |
| ~QSslError() | |
| QSslCertificate | certificate() const |
| QSslError::SslError | error() const |
| QString | errorString() const |
| void | swap(QSslError &other) |
| bool | operator!=(const QSslError &other) const |
| QSslError & | operator=(const QSslError &other) |
| bool | operator==(const QSslError &other) const |
详细说明
QSslError 提供了一个简单的 API,用于管理QSslSocket 中的 SSL 握手过程中的错误。
另请参阅 QSslSocket 、QSslCertificate 和QSslCipher 。
成员类型文档
enum QSslError::SslError
描述了SSL握手过程中可能出现的已知错误。
| 常量 | 值 |
|---|---|
QSslError::NoError | 0 |
QSslError::UnableToGetIssuerCertificate | 1 |
QSslError::UnableToDecryptCertificateSignature | 2 |
QSslError::UnableToDecodeIssuerPublicKey | 3 |
QSslError::CertificateSignatureFailed | 4 |
QSslError::CertificateNotYetValid | 5 |
QSslError::CertificateExpired | 6 |
QSslError::InvalidNotBeforeField | 7 |
QSslError::InvalidNotAfterField | 8 |
QSslError::SelfSignedCertificate | 9 |
QSslError::SelfSignedCertificateInChain | 10 |
QSslError::UnableToGetLocalIssuerCertificate | 11 |
QSslError::UnableToVerifyFirstCertificate | 12 |
QSslError::CertificateRevoked | 13 |
QSslError::InvalidCaCertificate | 14 |
QSslError::PathLengthExceeded | 15 |
QSslError::InvalidPurpose | 16 |
QSslError::CertificateUntrusted | 17 |
QSslError::CertificateRejected | 18 |
QSslError::SubjectIssuerMismatch | 19 |
QSslError::AuthorityIssuerSerialNumberMismatch | 20 |
QSslError::NoPeerCertificate | 21 |
QSslError::HostNameMismatch | 22 |
QSslError::UnspecifiedError | -1 |
QSslError::NoSslSupport | 23 |
QSslError::CertificateBlacklisted | 24 |
QSslError::CertificateStatusUnknown | 25 |
QSslError::OcspNoResponseFound | 26 |
QSslError::OcspMalformedRequest | 27 |
QSslError::OcspMalformedResponse | 28 |
QSslError::OcspInternalError | 29 |
QSslError::OcspTryLater | 30 |
QSslError::OcspSigRequred | 31 |
QSslError::OcspUnauthorized | 32 |
QSslError::OcspResponseCannotBeTrusted | 33 |
QSslError::OcspResponseCertIdUnknown | 34 |
QSslError::OcspResponseExpired | 35 |
QSslError::OcspStatusUnknown | 36 |
另请参阅 QSslError::errorString()。
成员函数文档
QSslError::QSslError()
创建一个不包含错误且使用默认证书的 QSslError 对象。
[explicit] QSslError::QSslError(QSslError::SslError error)
创建一个 QSslError 对象。该参数指定了发生的error 。
QSslError::QSslError(QSslError::SslError error, const QSslCertificate &certificate)
创建一个 QSslError 对象。这两个参数分别指定了发生的error ,以及该错误所涉及的certificate 。
另请参阅 QSslCertificate 。
QSslError::QSslError(const QSslError &other)
创建other 的完全相同的副本。
[noexcept] QSslError::~QSslError()
销毁QSslError 对象。
QSslCertificate QSslError::certificate() const
返回与该错误相关的证书;如果该错误与任何证书均无关,则返回空证书。
另请参阅 error() 和errorString()。
QSslError::SslError QSslError::error() const
返回错误的类型。
另请参阅 errorString() 和certificate()。
QString QSslError::errorString() const
返回一条简短、本地化且易于理解的错误描述。
另请参阅 error() 和certificate()。
[noexcept] void QSslError::swap(QSslError &other)
将此错误实例替换为other 。此操作速度极快,且绝不会失败。
bool QSslError::operator!=(const QSslError &other) const
如果该错误不等于other ,则返回true ;否则返回false。
QSslError &QSslError::operator=(const QSslError &other)
将other 中的内容赋值给此错误。
bool QSslError::operator==(const QSslError &other) const
如果该错误等于other ,则返回true ;否则返回false 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.