本页内容

sslConfiguration QML Type

sslConfiguration 类保存 SSL 连接的配置和状态。更多内容...

Import Statement: import QtNetwork
Since: Qt 6.7

属性

方法

详细说明

sslConfiguration 用于传递有关已建立的 SSL 连接的信息,并允许应用程序控制该连接的某些功能。sslConfiguration 内部封装了一个 `QSslConfiguration ` 对象。通过调用 `QSslConfiguration::defaultConfiguration` 方法,可以初始化 sslConfiguration 的默认值。

另请参阅 QSslConfiguration 。

属性文档

ciphers : string

将此配置的加密套件设置为ciphers ,这是一个以冒号分隔的加密套件名称列表。

另请参阅 QSslConfiguration::ciphers 。

peerVerifyDepth : int

指定在 SSL 握手阶段需检查的对等方证书链中的最大证书数量;若未设置最大深度,则为 0(默认值),表示应检查整个证书链。

另请参阅 QSslConfiguration::peerVerifyDepth 。

peerVerifyMode : enumeration

存储 PeerVerifyMode 枚举值。

另请参阅 QSslSocket::PeerVerifyMode 。

protocol : enumeration

存储 SslProtocol 枚举值。

另请参阅 QSsl::SslProtocol 。

sessionTicket : bytearray

以 ASN.1 格式存储 SSL 握手过程中使用的会话凭证,适合(例如)持久化到磁盘。

另请参阅 QSslConfiguration::sessionTicket 。

sslOptionFlags : QSsl::SslOptions [since 6.11]

包含配置中已启用的 SslOption 值的按位或运算结果。

默认值与QSslConfiguration::defaultConfiguration() 设置的值相同。

该属性自 Qt 6.11 起引入。

另请参阅 QSsl::SslOptions 。

方法文档

void setCertificateFiles(const QStringList &certificateFiles)

该函数将用户提供的证书列表certificateFiles 加载到配置中。

void setPrivateKey(const QQmlSslKey &privateKey)

此函数将用户自定义的私钥值privateKey 写入配置。

另请参阅 QSslKey 和sslKey 。

© 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.