ssl.SSLSyscallError

exception ssl.SSLSyscallError A subclass of SSLError raised when a system error was encountered while trying to fulfill an operation on a SSL socket. Unfortunately, there is no easy way to inspect the original errno number. New in version 3.3.

ssl.SSLSocket.write()

SSLSocket.write(buf) Write buf to the SSL socket and return the number of bytes written. The buf argument must be an object supporting the buffer interface. Raise SSLWantReadError or SSLWantWriteError if the socket is non-blocking and the write would block. As at any time a re-negotiation is possible, a call to write() can also cause read operations. Changed in version 3.5: The socket timeout is no more reset each time bytes are received or sent. The socket timeout is now to maximum total d

ssl.SSLSocket.version()

SSLSocket.version() Return the actual SSL protocol version negotiated by the connection as a string, or None is no secure connection is established. As of this writing, possible return values include "SSLv2", "SSLv3", "TLSv1", "TLSv1.1" and "TLSv1.2". Recent OpenSSL versions may define more return values. New in version 3.5.

ssl.SSLSocket.unwrap()

SSLSocket.unwrap() Performs the SSL shutdown handshake, which removes the TLS layer from the underlying socket, and returns the underlying socket object. This can be used to go from encrypted operation over a connection to unencrypted. The returned socket should always be used for further communication with the other side of the connection, rather than the original socket.

ssl.SSLSocket.shared_ciphers()

SSLSocket.shared_ciphers() Return the list of ciphers shared by the client during the handshake. Each entry of the returned list is a three-value tuple containing the name of the cipher, the version of the SSL protocol that defines its use, and the number of secret bits the cipher uses. shared_ciphers() returns None if no connection has been established or the socket is a client socket. New in version 3.5.

ssl.SSLSocket.server_side

SSLSocket.server_side A boolean which is True for server-side sockets and False for client-side sockets. New in version 3.2.

ssl.SSLSocket.server_hostname

SSLSocket.server_hostname Hostname of the server: str type, or None for server-side socket or if the hostname was not specified in the constructor. New in version 3.2.

ssl.SSLSocket.selected_npn_protocol()

SSLSocket.selected_npn_protocol() Return the higher-level protocol that was selected during the TLS/SSL handshake. If SSLContext.set_npn_protocols() was not called, or if the other party does not support NPN, or if the handshake has not yet happened, this will return None. New in version 3.3.

ssl.SSLSocket.selected_alpn_protocol()

SSLSocket.selected_alpn_protocol() Return the protocol that was selected during the TLS handshake. If SSLContext.set_alpn_protocols() was not called, if the other party does not support ALPN, if this socket does not support any of the client’s proposed protocols, or if the handshake has not happened yet, None is returned. New in version 3.5.

ssl.SSLSocket.read()

SSLSocket.read(len=1024, buffer=None) Read up to len bytes of data from the SSL socket and return the result as a bytes instance. If buffer is specified, then read into the buffer instead, and return the number of bytes read. Raise SSLWantReadError or SSLWantWriteError if the socket is non-blocking and the read would block. As at any time a re-negotiation is possible, a call to read() can also cause write operations. Changed in version 3.5: The socket timeout is no more reset each time byte