Deprecated since 3.6. It is deprecated to create a SSLSocket instance directly, use SSLContext.wrap_socket() to wrap a socket.
This class implements a subtype of socket.socket that wraps
the underlying OS socket in an SSL context when necessary, and
provides read and write methods over that channel.
3.5: The shutdown() does not reset the socket timeout each time bytes are received or sent. The socket timeout is now the maximum total duration of the shutdown.
3.7: SSLSocket instances must be created with wrap_socket(). In earlier versions, it was possible to create instances directly. This was never documented or officially supported.
3.10: Python now uses SSL_read_ex and SSL_write_ex internally. The functions support reading and writing of data larger than 2 GB. Writing zero-length data no longer fails with a protocol violation error.
3.15: Python now uses SSL_sendfile internally when possible. The function sends a file more efficiently because it performs TLS encryption in the kernel to avoid additional context switches.
Return the currently selected ALPN protocol as a string, or ``None`` if a next protocol was not negotiated or if ALPN is not supported by one of the peers.
Return the currently selected NPN protocol as a string, or ``None`` if a next protocol was not negotiated or if NPN is not supported by one of the peers.