Skip to content

PythonQt.Qt.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 (shared captured text)
NextProtocolNegotiationNone attribute Any (shared captured text)
NextProtocolNegotiationStatus attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
NextProtocolNegotiationUnsupported attribute Any (shared captured text)
__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. (shared captured text)
caCertificates function (self) -> tuple X.caCertificates() -> tuple (shared captured text)
ciphers function (self) -> tuple X.ciphers() -> tuple (shared captured text)
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 (shared captured text)
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 (shared captured text)
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 (shared captured text)
localCertificate function (self) -> Any X.localCertificate() -> PythonQt.QtNetwork.QSslCertificate (shared captured text)
localCertificateChain function (self) -> tuple X.localCertificateChain() -> tuple (shared captured text)
nextNegotiatedProtocol function (self) -> Any X.nextNegotiatedProtocol() -> PythonQt.QtCore.QByteArray (shared captured text)
nextProtocolNegotiationStatus function (self) -> Any This function returns the status of the Next Protocol Negotiation (NPN) or. (shared captured text)
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtNetwork.QSslConfiguration (shared captured text)
peerCertificate function (self) -> Any X.peerCertificate() -> PythonQt.QtNetwork.QSslCertificate (shared captured text)
peerCertificateChain function (self) -> tuple X.peerCertificateChain() -> tuple (shared captured text)
peerVerifyDepth function (self) -> int X.peerVerifyDepth() -> int (shared captured text)
peerVerifyMode function (self) -> Any Returns the verify mode. (shared captured text)
privateKey function (self) -> Any X.privateKey() -> PythonQt.QtNetwork.QSslKey (shared captured text)
protocol function (self) -> Any Returns the protocol setting for this SSL configuration. (shared captured text)
sessionCipher function (self) -> Any X.sessionCipher() -> PythonQt.QtNetwork.QSslCipher (shared captured text)
sessionProtocol function (self) -> Any Returns the socket's SSL/TLS protocol or UnknownProtocol if the connection isn't encrypted. (shared captured text)
sessionTicket function (self) -> Any X.sessionTicket() -> PythonQt.QtCore.QByteArray (shared captured text)
sessionTicketLifeTimeHint function (self) -> int X.sessionTicketLifeTimeHint() -> int (shared captured text)
setAllowedNextProtocols function (self, protocols: Any) -> None This function sets the allowed protocols to be negotiated with the server through the. (shared captured text)
setCaCertificates function (self, certificates: Any) -> None Sets this socket's CA certificate database to be certificates. (shared captured text)
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… (shared captured text)
setDefaultConfiguration function (self, configuration: Any) -> None Sets the default SSL configuration to be used in new SSL connections to be configuration. (shared captured text)
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… (shared captured text)
setLocalCertificate function (self, certificate: Any) -> None Sets the certificate to be presented to the peer during SSL handshake to be certificate. (shared captured text)
setLocalCertificateChain function (self, localChain: Any) -> None Sets the certificate chain to be presented to the peer during the SSL handshake to be localChain. (shared captured text)
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. (shared captured text)
setPeerVerifyMode function (self, mode: Any) -> None Sets the verify mode to mode. (shared captured text)
setPrivateKey function (self, key: Any) -> None Sets the connection's private [key](https://doc.qt.io/archives/qt-5.15/qsslkey.html) to key. (shared captured text)
setProtocol function (self, protocol: Any) -> None Sets the protocol setting for this configuration to be protocol. (shared captured text)
setSessionTicket function (self, sessionTicket: Any) -> None Sets the session ticket to be used in an SSL handshake. (shared captured text)
setSslOption function (self, option: Any, on: bool) -> None X.setSslOption(option, on) (shared captured text)
supportedCiphers function (self) -> tuple X.supportedCiphers() -> tuple (shared captured text)
supportedEllipticCurves function (self) -> tuple X.supportedEllipticCurves() -> tuple (shared captured text)
swap function (self, other: Any) -> None Swaps this SSL configuration instance with other. (shared captured text)
systemCaCertificates function (self) -> tuple X.systemCaCertificates() -> tuple (shared captured text)
testSslOption function (self, option: Any) -> bool X.testSslOption(option) -> bool (shared captured text)