QSsl

PyQt5.QtNetwork.QSsl

Description

TODO

Classes

SslOptions

Enums

AlternativeNameEntryType

TODO

Member

Value

Description

DnsEntry

TODO

TODO

EmailEntry

TODO

TODO

IpAddressEntry

TODO

TODO


EncodingFormat

Describes supported encoding formats for certificates and keys.

Member

Value

Description

Der

1

The DER format.

Pem

0

The PEM format.


KeyAlgorithm

Describes the different key algorithms supported by QSslKey.

The opaque key facility allows applications to add support for facilities such as PKCS#11 that Qt does not currently offer natively.

Member

Value

Description

Dh

TODO

TODO

Dsa

1

The DSA algorithm.

Ec

TODO

The Elliptic Curve algorithm

Opaque

TODO

A key that should be treated as a ‘black box’ by QSslKey.

Rsa

0

The RSA algorithm.


KeyType

Describes the two types of keys QSslKey supports.

Member

Value

Description

PrivateKey

0

A private key.

PublicKey

1

A public key.


SslOption

Describes the options that can be used to control the details of SSL behaviour. These options are generally used to turn features off to work around buggy servers.

By default, is turned on since this causes problems with a large number of servers. is also turned on, since it introduces a security risk. is turned on to prevent the attack publicised by CRIME. SslOptionDisableSessionPersistence is turned on to optimize memory usage. The other options are turned off.

Note: Availability of above options depends on the version of the SSL backend in use.

Member

Value

Description

SslOptionDisableCompression

0x04

Disables the SSL compression extension. When enabled, this allows the data being passed over SSL to be compressed, however some servers are not compatible with this extension.

SslOptionDisableEmptyFragments

0x01

Disables the insertion of empty fragments into the data when using block ciphers. When enabled, this prevents some attacks (such as the BEAST attack), however it is incompatible with some servers.

SslOptionDisableLegacyRenegotiation

0x10

Disables the older insecure mechanism for renegotiating the connection parameters. When enabled, this option can allow connections for legacy servers, but it introduces the possibility that an attacker could inject plaintext into the SSL session.

SslOptionDisableServerCipherPreference

TODO

Disables selecting the cipher chosen based on the servers preferences rather than the order ciphers were sent by the client. This option is only relevant to server sockets, and is only honored by the OpenSSL backend.

SslOptionDisableServerNameIndication

0x08

Disables the SSL server name indication extension. When enabled, this tells the server the virtual host being accessed allowing it to respond with the correct certificate.

SslOptionDisableSessionPersistence

TODO

Disables storing the SSL session in ASN.1 format as returned by QSslConfiguration::sessionTicket(). Enabling this feature adds memory overhead of approximately 1K per used session ticket.

SslOptionDisableSessionSharing

TODO

Disables SSL session sharing via the session ID handshake attribute.

SslOptionDisableSessionTickets

0x02

Disables the SSL session ticket extension. This can cause slower connection setup, however some servers are not compatible with the extension.


SslProtocol

Describes the protocol of the cipher.

Note: most servers understand both SSL and TLS, but it is recommended to use TLS only for security reasons. However, SSL and TLS are not compatible with each other: if you get unexpected handshake failures, verify that you chose the correct setting for your protocol.

Member

Value

Description

AnyProtocol

3

The socket understands SSLv2, SSLv3, TLSv1.0 and all supported later versions of TLS. This value is used by QSslSocket only.

DtlsV1_0

TODO

DTLSv1.0

DtlsV1_0OrLater

TODO

DTLSv1.0 and later versions.

DtlsV1_2

TODO

DTLSv1.2

DtlsV1_2OrLater

TODO

DTLSv1.2 and later versions.

SecureProtocols

5

The default option, using protocols known to be secure; currently behaves similar to TlsV1Ssl3 except denying SSLv3 connections that does not upgrade to TLS.

SslV2

1

SSLv2. Note, SSLv2 support was removed in OpenSSL 1.1.

SslV3

0

SSLv3. When using the WinRT backend this option will also enable TLSv1.0

TlsV1_0

TODO

TLSv1.0

TlsV1_0OrLater

TODO

TLSv1.0 and later versions. This option is not available when using the WinRT backend due to platform limitations.

TlsV1_1

TODO

TLSv1.1. When using the WinRT backend this option will also enable TLSv1.0.

TlsV1_1OrLater

TODO

TLSv1.1 and later versions. This option is not available when using the WinRT backend due to platform limitations.

TlsV1_2

TODO

TLSv1.2. When using the WinRT backend this option will also enable TLSv1.0 and TLSv1.1.

TlsV1_2OrLater

TODO

TLSv1.2 and later versions. This option is not available when using the WinRT backend due to platform limitations.

TlsV1_3

TODO

TLSv1.3. (Since Qt 5.12)

TlsV1_3OrLater

TODO

TLSv1.3 and later versions. (Since Qt 5.12)

TlsV1SslV3

4

On the client side, this will send a TLS 1.0 Client Hello, enabling TLSv1_0 and SSLv3 connections. On the server side, this will enable both SSLv3 and TLSv1_0 connections.

UnknownProtocol

-1

The cipher’s protocol cannot be determined.