PythonQt.QtNetwork.QSslSocket · declarations 001
Back to PythonQt.QtNetwork.QSslSocket
AutoVerifyPeer
instance-attribute
AutoVerifyPeer: Any
PeerVerifyMode
instance-attribute
PeerVerifyMode: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
QueryPeer
instance-attribute
QueryPeer: Any
SslClientMode
instance-attribute
SslClientMode: Any
SslMode
instance-attribute
SslMode: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SslServerMode
instance-attribute
SslServerMode: Any
UnencryptedMode
instance-attribute
UnencryptedMode: Any
VerifyNone
instance-attribute
VerifyNone: Any
VerifyPeer
instance-attribute
VerifyPeer: Any
abort
abort() -> None
X.abort()
Supplemental documentation: Qt 5 reference:
void QSslSocket::abort()
Aborts the current connection and resets the socket. Unlike disconnectFromHost(), this function immediately closes the socket, clearing any pending data in the write buffer.
See also disconnectFromHost() and close().
Upstream PySide2 reference signatures (binding differences may apply):
abort(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#abort
aboutToClose
aboutToClose(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.aboutToClose; argument details are not documented.
addCaCertificate
addCaCertificate(certificate: Any) -> None
X.addCaCertificate(certificate)
Upstream PySide2 reference signatures (binding differences may apply):
addCaCertificate(self, certificate: PySide2.QtNetwork.QSslCertificate) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#addCaCertificate
addCaCertificates
addCaCertificates(path: Any, format: Any, syntax: Any) -> Any
X.addCaCertificates(path, format, syntax)
Upstream PySide2 reference signatures (binding differences may apply):
addCaCertificates(self, certificates: typing.Sequence[PySide2.QtNetwork.QSslCertificate]) -> None
addCaCertificates(self, path: str, format: PySide2.QtNetwork.QSsl.EncodingFormat=..., syntax: PySide2.QtCore.QRegExp.PatternSyntax=...) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#addCaCertificates
addDefaultCaCertificate
addDefaultCaCertificate(certificate: Any) -> None
X.addDefaultCaCertificate(certificate)
Upstream PySide2 reference signatures (binding differences may apply):
addDefaultCaCertificate(certificate: PySide2.QtNetwork.QSslCertificate) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#addDefaultCaCertificate
addDefaultCaCertificates
addDefaultCaCertificates(path: Any, format: Any, syntax: Any) -> Any
X.addDefaultCaCertificates(path, format, syntax)
Upstream PySide2 reference signatures (binding differences may apply):
addDefaultCaCertificates(certificates: typing.Sequence[PySide2.QtNetwork.QSslCertificate]) -> None
addDefaultCaCertificates(path: str, format: PySide2.QtNetwork.QSsl.EncodingFormat=..., syntax: PySide2.QtCore.QRegExp.PatternSyntax=...) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#addDefaultCaCertificates
atEnd
atEnd() -> bool
X.atEnd() -> bool
Supplemental documentation: Qt 5 reference:
[override virtual] bool QSslSocket::atEnd() const
Reimplements: QAbstractSocket::atEnd() const.
Upstream PySide2 reference signatures (binding differences may apply):
atEnd(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#atEnd
bind
bind(address: Any, port: Any, mode: Any) -> bool
X.bind(address, port, mode) -> bool
bytesAvailable
bytesAvailable() -> int
X.bytesAvailable() -> int
Supplemental documentation: Qt 5 reference:
[override virtual] qint64 QSslSocket::bytesAvailable() const
Reimplements: QAbstractSocket::bytesAvailable() const.
Returns the number of decrypted bytes that are immediately available for reading.
Upstream PySide2 reference signatures (binding differences may apply):
bytesAvailable(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#bytesAvailable
bytesToWrite
bytesToWrite() -> int
X.bytesToWrite() -> int
Supplemental documentation: Qt 5 reference:
[override virtual] qint64 QSslSocket::bytesToWrite() const
Reimplements: QAbstractSocket::bytesToWrite() const.
Returns the number of unencrypted bytes that are waiting to be encrypted and written to the network.
Upstream PySide2 reference signatures (binding differences may apply):
bytesToWrite(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#bytesToWrite
bytesWritten
bytesWritten(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.bytesWritten; argument details are not documented.
caCertificates
caCertificates() -> tuple
X.caCertificates() -> tuple
Upstream PySide2 reference signatures (binding differences may apply):
caCertificates(self) -> typing.List[PySide2.QtNetwork.QSslCertificate]
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#caCertificates
canReadLine
canReadLine() -> bool
X.canReadLine() -> bool
Supplemental documentation: Qt 5 reference:
[override virtual] bool QSslSocket::canReadLine() const
Reimplements: QAbstractSocket::canReadLine() const.
Returns true if you can read one while line (terminated by a single ASCII '\n'
character) of decrypted characters; otherwise, false is returned.
Upstream PySide2 reference signatures (binding differences may apply):
canReadLine(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#canReadLine
channelBytesWritten
channelBytesWritten(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.channelBytesWritten; argument details are not documented.
channelReadyRead
channelReadyRead(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.channelReadyRead; argument details are not documented.
ciphers
ciphers() -> tuple
X.ciphers() -> tuple
Upstream PySide2 reference signatures (binding differences may apply):
ciphers(self) -> typing.List[PySide2.QtNetwork.QSslCipher]
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#ciphers
close
close() -> None
X.close()
Supplemental documentation: Qt 5 reference:
[override virtual] void QSslSocket::close()
Reimplements: QAbstractSocket::close().
Upstream PySide2 reference signatures (binding differences may apply):
close(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#close
connectToHost
connectToHost(hostName: Any, port: int, openMode: Any, protocol: Any) -> None
X.connectToHost(hostName, port, openMode, protocol)
Upstream PySide2 reference signatures (binding differences may apply):
connectToHost(self, address: PySide2.QtNetwork.QHostAddress, port: int, mode: PySide2.QtCore.QIODevice.OpenMode=...) -> None
connectToHost(self, hostName: str, port: int, openMode: PySide2.QtCore.QIODevice.OpenMode=..., protocol: PySide2.QtNetwork.QAbstractSocket.NetworkLayerProtocol=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#connectToHost
connectToHostEncrypted
connectToHostEncrypted(hostName: str, port: int, sslPeerName: Any, mode: Any, protocol: Any) -> None
X.connectToHostEncrypted(hostName, port, sslPeerName, mode, protocol)
Supplemental documentation: Qt 5 reference:
void QSslSocket::connectToHostEncrypted(const QString \&hostName, quint16 port, QIODevice::OpenMode mode \= ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol \= AnyIPProtocol)
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
void QSslSocket::connectToHostEncrypted(const QString \&hostName, quint16 port, const QString \&sslPeerName, QIODevice::OpenMode mode \= ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol \= AnyIPProtocol)
This is an overloaded function.
In addition to the original behaviour of connectToHostEncrypted, this overloaded method enables the usage of a different hostname (sslPeerName) for the certificate validation instead of the one used for the TCP connection (hostName).
This function was introduced in Qt 4.6.
See also connectToHostEncrypted().
Upstream PySide2 reference signatures (binding differences may apply):
connectToHostEncrypted(self, hostName: str, port: int, mode: PySide2.QtCore.QIODevice.OpenMode=..., protocol: PySide2.QtNetwork.QAbstractSocket.NetworkLayerProtocol=...) -> None
connectToHostEncrypted(self, hostName: str, port: int, sslPeerName: str, mode: PySide2.QtCore.QIODevice.OpenMode=..., protocol: PySide2.QtNetwork.QAbstractSocket.NetworkLayerProtocol=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#connectToHostEncrypted
connected
connected(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.connected; argument details are not documented.
defaultCaCertificates
defaultCaCertificates() -> tuple
X.defaultCaCertificates() -> tuple
Upstream PySide2 reference signatures (binding differences may apply):
defaultCaCertificates() -> typing.List[PySide2.QtNetwork.QSslCertificate]
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#defaultCaCertificates
defaultCiphers
defaultCiphers() -> tuple
X.defaultCiphers() -> tuple
Upstream PySide2 reference signatures (binding differences may apply):
defaultCiphers() -> typing.List[PySide2.QtNetwork.QSslCipher]
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#defaultCiphers
destroyed
destroyed(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.destroyed; argument details are not documented.
disconnectFromHost
disconnectFromHost() -> None
X.disconnectFromHost()
Upstream PySide2 reference signatures (binding differences may apply):
disconnectFromHost(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#disconnectFromHost
disconnected
disconnected(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.disconnected; argument details are not documented.
encrypted
encrypted(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.encrypted; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QSslSocket::encrypted()
This signal is emitted when QSslSocket enters encrypted mode. After this signal has been emitted, QSslSocket::isEncrypted() will return true, and all further transmissions on the socket will be encrypted.
See also QSslSocket::connectToHostEncrypted() and QSslSocket::isEncrypted().
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#encrypted
encryptedBytesAvailable
encryptedBytesAvailable() -> int
X.encryptedBytesAvailable() -> int
Supplemental documentation: Qt 5 reference:
qint64 QSslSocket::encryptedBytesAvailable() const
Returns the number of encrypted bytes that are awaiting decryption. Normally, this function will return 0 because QSslSocket decrypts its incoming data as soon as it can.
This function was introduced in Qt 4.4.
Upstream PySide2 reference signatures (binding differences may apply):
encryptedBytesAvailable(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#encryptedBytesAvailable
encryptedBytesToWrite
encryptedBytesToWrite() -> int
X.encryptedBytesToWrite() -> int
Supplemental documentation: Qt 5 reference:
qint64 QSslSocket::encryptedBytesToWrite() const
Returns the number of encrypted bytes that are waiting to be written to the network.
This function was introduced in Qt 4.4.
Upstream PySide2 reference signatures (binding differences may apply):
encryptedBytesToWrite(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#encryptedBytesToWrite
encryptedBytesWritten
encryptedBytesWritten(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.encryptedBytesWritten; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QSslSocket::encryptedBytesWritten(qint64 written)
This signal is emitted when QSslSocket writes its encrypted data to the network. The written parameter contains the number of bytes that were successfully written.
This function was introduced in Qt 4.4.
See also QIODevice::bytesWritten().
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#encryptedBytesWritten
errorOccurred
errorOccurred(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtNetwork.QSslSocket.errorOccurred; argument details are not documented.
flush
flush() -> bool
X.flush() -> bool
Supplemental documentation: Qt 5 reference:
bool QSslSocket::flush()
This function writes as much as possible from the internal write buffer to the
underlying network socket, without blocking. If any data was written, this function
returns true; otherwise false is returned.
Call this function if you need QSslSocket to start sending buffered data immediately. The number of bytes successfully written depends on the operating system. In most cases, you do not need to call this function, because QAbstractSocket will start sending data automatically once control goes back to the event loop. In the absence of an event loop, call waitForBytesWritten() instead.
See also write() and waitForBytesWritten().
Upstream PySide2 reference signatures (binding differences may apply):
flush(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsslsocket.html#flush