pybitmessage.network.tls module

SSL/TLS negotiation.

class TLSDispatcher(address=None, sock=None, certfile=None, keyfile=None, server_side=False, ciphers='AECDH-AES256-SHA')[source]

Bases: network.advanceddispatcher.AdvancedDispatcher

TLS functionality for classes derived from AdvancedDispatcher

handle_read()

Handle reads for sockets during TLS handshake. Requires special treatment as during the handshake, buffers must remain empty and normal reads must be ignored.

handle_write()

Handle writes for sockets during TLS handshake. Requires special treatment as during the handshake, buffers must remain empty and normal writes must be ignored.

readable()

Handle readable check for TLS-enabled sockets

static state_tls_handshake()

Do nothing while TLS handshake is pending, as during this phase we need to react to callbacks instead

state_tls_init()

Prepare sockets for TLS handshake

tls_handshake()

Perform TLS handshake and handle its stages

writable()

Handle writable checks for TLS-enabled sockets