class documentation

class WrappedSocket(object): (source)

View In Hierarchy

API-compatibility wrapper for Python's OpenSSL wrapped socket object. Note: _makefile_refs, _drop(), and _reuse() are needed for the garbage collector of PyPy.

Method __init__ Undocumented
Method close Undocumented
Method fileno Undocumented
Method getpeercert Undocumented
Method gettimeout Undocumented
Method handshake Actually performs the TLS handshake. This is run automatically by wrapped socket, and shouldn't be needed in user code.
Method recv Undocumented
Method recv_into Undocumented
Method send Undocumented
Method sendall Undocumented
Method settimeout Undocumented
Method shutdown Undocumented
Method version Undocumented
Instance Variable context Undocumented
Instance Variable socket Undocumented
Method _custom_validate Called when we have set custom validation. We do this in two cases: first, when cert validation is entirely disabled; and second, when using a custom trust DB. Raises an SSLError if the connection is not trusted.
Method _decref_socketios Undocumented
Method _drop Undocumented
Method _evaluate_trust Undocumented
Method _raise_on_error A context manager that can be used to wrap calls that do I/O from SecureTransport. If any of the I/O callbacks hit an exception, this context manager will correctly propagate the exception after the fact...
Method _reuse Undocumented
Method _set_alpn_protocols Sets up the ALPN protocols on the context.
Method _set_ciphers Sets up the allowed ciphers. By default this matches the set in util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done custom and doesn't allow changing at this time, mostly because parsing OpenSSL cipher strings is going to be a freaking nightmare.
Instance Variable _client_cert_chain Undocumented
Instance Variable _closed Undocumented
Instance Variable _exception Undocumented
Instance Variable _keychain Undocumented
Instance Variable _keychain_dir Undocumented
Instance Variable _makefile_refs Undocumented
Instance Variable _timeout Undocumented
def __init__(self, socket): (source)

Undocumented

def close(self): (source)

Undocumented

def fileno(self): (source)

Undocumented

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

Undocumented

def gettimeout(self): (source)

Undocumented

def handshake(self, server_hostname, verify, trust_bundle, min_version, max_version, client_cert, client_key, client_key_passphrase, alpn_protocols): (source)

Actually performs the TLS handshake. This is run automatically by wrapped socket, and shouldn't be needed in user code.

def recv(self, bufsiz): (source)

Undocumented

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

Undocumented

def send(self, data): (source)

Undocumented

def sendall(self, data): (source)

Undocumented

def settimeout(self, timeout): (source)

Undocumented

def shutdown(self): (source)

Undocumented

def version(self): (source)

Undocumented

Undocumented

Undocumented

def _custom_validate(self, verify, trust_bundle): (source)

Called when we have set custom validation. We do this in two cases: first, when cert validation is entirely disabled; and second, when using a custom trust DB. Raises an SSLError if the connection is not trusted.

def _decref_socketios(self): (source)

Undocumented

def _drop(self): (source)

Undocumented

def _evaluate_trust(self, trust_bundle): (source)

Undocumented

@contextlib.contextmanager
def _raise_on_error(self): (source)

A context manager that can be used to wrap calls that do I/O from SecureTransport. If any of the I/O callbacks hit an exception, this context manager will correctly propagate the exception after the fact. This avoids silently swallowing those exceptions. It also correctly forces the socket closed.

def _reuse(self): (source)

Undocumented

def _set_alpn_protocols(self, protocols): (source)

Sets up the ALPN protocols on the context.

def _set_ciphers(self): (source)

Sets up the allowed ciphers. By default this matches the set in util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done custom and doesn't allow changing at this time, mostly because parsing OpenSSL cipher strings is going to be a freaking nightmare.

_client_cert_chain = (source)

Undocumented

Undocumented

_exception = (source)

Undocumented

_keychain = (source)

Undocumented

_keychain_dir = (source)

Undocumented

_makefile_refs: int = (source)

Undocumented

_timeout = (source)

Undocumented