Skip to content

PythonQt.QtNetwork.QSslConfiguration

QSslConfiguration

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QSslConfiguration is used by Qt networking classes to relay information about an open SSL connection and to allow the application to control certain features of that connection.

The settings that QSslConfiguration currently supports are:

  • The SSL/TLS protocol to be used
  • The certificate to be presented to the peer during connection and its associated private key
  • The ciphers allowed to be used for encrypting the connection
  • The list of Certificate Authorities certificates that are used to validate the peer's certificate

These settings are applied only during the connection handshake. Setting them after the connection has been established has no effect.

The state that QSslConfiguration supports are:

  • The certificate the peer presented during handshake, along with the chain leading to a CA certificate
  • The cipher used to encrypt this session

The state can only be obtained once the SSL connection starts, but not necessarily before it's done. Some settings may change during the course of the SSL connection without need to restart it (for instance, the cipher can be changed over time).

State in QSslConfiguration objects cannot be changed.

QSslConfiguration can be used with QSslSocket and the Network Access API.

Note that changing settings in QSslConfiguration is not enough to change the settings in the related SSL connection. You must call setSslConfiguration on a modified QSslConfiguration object to achieve that. The following example illustrates how to change the protocol to TLSv1_0 in a QSslSocket object:

QSslConfiguration config = sslSocket.sslConfiguration();
config.setProtocol(QSsl::TlsV1_0);
sslSocket.setSslConfiguration(config);

Source: https://doc.qt.io/archives/qt-5.15/qsslconfiguration.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
NextProtocolNegotiationNegotiated attribute Any
NextProtocolNegotiationNone attribute Any
NextProtocolNegotiationStatus attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
NextProtocolNegotiationUnsupported attribute Any
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
allowedNextProtocols function (self) -> Any This function returns the allowed protocols to be negotiated with the server through the.
caCertificates function (self) -> tuple X.caCertificates() -> tuple
ciphers function (self) -> tuple X.ciphers() -> tuple
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
defaultConfiguration function (self) -> Any X.defaultConfiguration() -> PythonQt.QtNetwork.QSslConfiguration
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
ellipticCurves function (self) -> tuple X.ellipticCurves() -> tuple
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isNull function (self) -> bool X.isNull() -> bool
localCertificate function (self) -> Any X.localCertificate() -> PythonQt.QtNetwork.QSslCertificate
localCertificateChain function (self) -> tuple X.localCertificateChain() -> tuple
nextNegotiatedProtocol function (self) -> Any X.nextNegotiatedProtocol() -> PythonQt.QtCore.QByteArray
nextProtocolNegotiationStatus function (self) -> Any This function returns the status of the Next Protocol Negotiation (NPN) or.
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtNetwork.QSslConfiguration
peerCertificate function (self) -> Any X.peerCertificate() -> PythonQt.QtNetwork.QSslCertificate
peerCertificateChain function (self) -> tuple X.peerCertificateChain() -> tuple
peerVerifyDepth function (self) -> int X.peerVerifyDepth() -> int
peerVerifyMode function (self) -> Any Returns the verify mode.
privateKey function (self) -> Any X.privateKey() -> PythonQt.QtNetwork.QSslKey
protocol function (self) -> Any Returns the protocol setting for this SSL configuration.
sessionCipher function (self) -> Any X.sessionCipher() -> PythonQt.QtNetwork.QSslCipher
sessionProtocol function (self) -> Any Returns the socket's SSL/TLS protocol or UnknownProtocol if the connection isn't encrypted.
sessionTicket function (self) -> Any X.sessionTicket() -> PythonQt.QtCore.QByteArray
sessionTicketLifeTimeHint function (self) -> int X.sessionTicketLifeTimeHint() -> int
setAllowedNextProtocols function (self, protocols: Any) -> None This function sets the allowed protocols to be negotiated with the server through the.
setCaCertificates function (self, certificates: Any) -> None Sets this socket's CA certificate database to be certificates.
setCiphers function (self, ciphers: Any) -> None Sets the cryptographic cipher suite for this socket to ciphers, which must contain a subset of the ciphers in the list returned by…
setDefaultConfiguration function (self, configuration: Any) -> None Sets the default SSL configuration to be used in new SSL connections to be configuration.
setEllipticCurves function (self, curves: Any) -> Any Sets the list of elliptic curves to be used by this socket to curves, which must contain a subset of the curves in the list returned by…
setLocalCertificate function (self, certificate: Any) -> None Sets the certificate to be presented to the peer during SSL handshake to be certificate.
setLocalCertificateChain function (self, localChain: Any) -> None Sets the certificate chain to be presented to the peer during the SSL handshake to be localChain.
setPeerVerifyDepth function (self, depth: int) -> None Sets the maximum number of certificates in the peer's certificate chain to be checked during the SSL handshake phase, to depth.
setPeerVerifyMode function (self, mode: Any) -> None Sets the verify mode to mode.
setPrivateKey function (self, key: Any) -> None Sets the connection's private [key](https://doc.qt.io/archives/qt-5.15/qsslkey.html) to key.
setProtocol function (self, protocol: Any) -> None Sets the protocol setting for this configuration to be protocol.
setSessionTicket function (self, sessionTicket: Any) -> None Sets the session ticket to be used in an SSL handshake.
setSslOption function (self, option: Any, on: bool) -> None X.setSslOption(option, on)
supportedCiphers function (self) -> tuple X.supportedCiphers() -> tuple
supportedEllipticCurves function (self) -> tuple X.supportedEllipticCurves() -> tuple
swap function (self, other: Any) -> None Swaps this SSL configuration instance with other.
systemCaCertificates function (self) -> tuple X.systemCaCertificates() -> tuple
testSslOption function (self, option: Any) -> bool X.testSslOption(option) -> bool