安全套接字层 (SSL) 类

Classes for secure communication over network sockets.

以下类为使用 SSL (安全套接字层) 协议进行安全网络通信提供支持,使用 OpenSSL 工具包 去履行加密和协议处理。

从 Qt 5.6 版起,官方支持的 OpenSSL 版本是 1.0.0 或更高。

QDtlsClientVerifier

This class implements server-side DTLS cookie generation and verification.

QDtlsClientVerifier.GeneratorParameters

This class defines parameters for DTLS cookie generator.

QDtls.QDtlsError

Describes errors that can be found by QDtls and QDtlsClientVerifier.

PySide2.QtNetwork.QDtls

此类为 UDP (用户数据报协议) 套接字提供加密。

QDtls.HandshakeState

描述 DTLS 握手的当前状态。

PySide2.QtNetwork.QOcspResponse

This class represents Online Certificate Status Protocol response.

QOcspResponse.QOcspCertificateStatus

描述在线证书状态

QOcspResponse.QOcspRevocationReason

描述撤销的原因

qssl.html

QSsl 名称空间声明用于 Qt Network 所有 SSL 类的公共枚举。

PySide2.QtNetwork.QSslCertificate

The QSslCertificate class provides a convenient API for an X509 certificate.

PySide2.QtNetwork.QSslCertificateExtension

The QSslCertificateExtension class provides an API for accessing the extensions of an X509 certificate.

PySide2.QtNetwork.QSslCipher

The QSslCipher class represents an SSL cryptographic cipher.

PySide2.QtNetwork.QSslConfiguration

QSslConfiguration 类保持 SSL 连接的配置和状态。

PySide2.QtNetwork.QSslDiffieHellmanParameters

The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers.

QSslEllipticCurve

Represents an elliptic curve for use by elliptic-curve cipher algorithms.

PySide2.QtNetwork.QSslError

The QSslError class provides an SSL error.

PySide2.QtNetwork.QSslKey

The QSslKey class provides an interface for private and public keys.

PySide2.QtNetwork.QSslPreSharedKeyAuthenticator

The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) ciphersuites.

PySide2.QtNetwork.QSslSocket

QSslSocket 类为客户端和服务器两者提供 SSL 加密套接字。

启用和禁用 SSL 支持

当从源代码构建 Qt 时,配置系统会检查是否存在 openssl/opensslv.h 由 OpenSSL 源代码或开发者包提供的 Header 头。

默认情况下,启用 SSL 的 Qt 库在运行时会动态加载任何已安装的 OpenSSL 库。无论如何,在编译时链接到库是可能的,通过配置 Qt 采用 -openssl-linked 选项。

When building a version of Qt linked against OpenSSL, the build system will attempt to link with libssl and libcrypt libraries located in the default location on the developer’s system. This location is configurable: set the OPENSSL_LIBS 环境变量以包含把 Qt 链接到已安装库所需的链接器选项。例如,在 Unix/Linux 系统:

OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked
											

要禁用 SSL 支持在 Qt 构建中,配置 Qt 采用 -no-openssl 选项。

安全数据报传输层

DTLS (安全数据报传输层) 是为基于数据报的应用程序,提供防窃听、防篡改或防消息伪造保护的一种安全协议。DTLS 协议基于面向流的 TLS (传输层安全) 协议。 QtNetwork 使能够使用采用 UDP (用户数据报协议) 的 DTLS,定义通过 RFC 6347 .

进出口限定

Qt 二进制安装程序包括的 OpenSSL 库,使用要通过 QtNetwork 。不管怎样,这些不会自动部署到采用 Qt 构建的应用程序中。进出口限定适用于某些类型的软件,也适用于世界某些地区。希望在部署应用程序中使用 SSL 通信的开发者应确保其用户有安装合适的库,或者,他们应咨询具备适当资格的法律专业人士,以确保使用 OpenSSL 工程代码的应用程序在世界相关地区得到正确进出口认证。