class documentation

class SSLTransport: (source)

View In Hierarchy

The SSLTransport wraps an existing socket and establishes an SSL connection. Contrary to Python's implementation of SSLSocket, it allows you to chain multiple TLS connections together. It's particularly useful if you need to implement TLS within TLS. The class supports most of the socket API operations.

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Create an SSLTransport around socket using the provided ssl_context.
Method cipher Undocumented
Method close Undocumented
Method compression Undocumented
Method fileno Undocumented
Method getpeercert Undocumented
Method gettimeout Undocumented
Method makefile Python's httpclient uses makefile and buffered io when reading HTTP messages and we need to support it.
Method read Undocumented
Method recv Undocumented
Method recv_into Undocumented
Method selected_alpn_protocol Undocumented
Method selected_npn_protocol Undocumented
Method send Undocumented
Method sendall Undocumented
Method settimeout Undocumented
Method shared_ciphers Undocumented
Method unwrap Undocumented
Method version Undocumented
Instance Variable incoming Undocumented
Instance Variable outgoing Undocumented
Instance Variable socket Undocumented
Instance Variable sslobj Undocumented
Instance Variable suppress_ragged_eofs Undocumented
Static Method _validate_ssl_context_for_tls_in_tls Raises a ProxySchemeUnsupported if the provided ssl_context can't be used for TLS in TLS.
Method _decref_socketios Undocumented
Method _ssl_io_loop Performs an I/O loop between incoming/outgoing and the socket.
Method _wrap_ssl_read Undocumented
def __enter__(self): (source)

Undocumented

def __exit__(self, *_): (source)

Undocumented

def __init__(self, socket, ssl_context, server_hostname=None, suppress_ragged_eofs=True): (source)

Create an SSLTransport around socket using the provided ssl_context.

def cipher(self): (source)

Undocumented

def close(self): (source)

Undocumented

def compression(self): (source)

Undocumented

def fileno(self): (source)

Undocumented

def getpeercert(self, binary_form=False): (source)

Undocumented

def gettimeout(self): (source)

Undocumented

def makefile(self, mode='r', buffering=None, encoding=None, errors=None, newline=None): (source)

Python's httpclient uses makefile and buffered io when reading HTTP messages and we need to support it. This is unfortunately a copy and paste of socket.py makefile with small changes to point to the socket directly.

def read(self, len=1024, buffer=None): (source)

Undocumented

def recv(self, len=1024, flags=0): (source)

Undocumented

def recv_into(self, buffer, nbytes=None, flags=0): (source)

Undocumented

def selected_alpn_protocol(self): (source)

Undocumented

def selected_npn_protocol(self): (source)

Undocumented

def send(self, data, flags=0): (source)

Undocumented

def sendall(self, data, flags=0): (source)

Undocumented

def settimeout(self, value): (source)

Undocumented

def shared_ciphers(self): (source)

Undocumented

def unwrap(self): (source)

Undocumented

def version(self): (source)

Undocumented

incoming = (source)

Undocumented

outgoing = (source)

Undocumented

Undocumented

Undocumented

suppress_ragged_eofs = (source)

Undocumented

@staticmethod
def _validate_ssl_context_for_tls_in_tls(ssl_context): (source)

Raises a ProxySchemeUnsupported if the provided ssl_context can't be used for TLS in TLS. The only requirement is that the ssl_context provides the 'wrap_bio' methods.

def _decref_socketios(self): (source)

Undocumented

def _ssl_io_loop(self, func, *args): (source)

Performs an I/O loop between incoming/outgoing and the socket.

def _wrap_ssl_read(self, len, buffer=None): (source)

Undocumented