backend.globaleaks.utils.sni

Module Contents

Classes

_NegotiationData A container for the negotiation data.
_ContextProxy A basic proxy object for the OpenSSL Context object that records the
_ConnectionProxy A basic proxy for an OpenSSL Connection object that returns a ContextProxy
SNIMap
class backend.globaleaks.utils.sni._NegotiationData[source]

Bases: object

A container for the negotiation data.

__slots__ = ['npnAdvertiseCallback', 'npnSelectCallback', 'alpnSelectCallback', 'alpnProtocols'][source]
negotiateNPN(self, context)[source]
negotiateALPN(self, context)[source]
class backend.globaleaks.utils.sni._ContextProxy(original, factory)[source]

Bases: object

A basic proxy object for the OpenSSL Context object that records the values of the NPN/ALPN callbacks, to ensure that they get set appropriately if a context is swapped out during connection setup.

set_npn_advertise_callback(self, cb)[source]
set_npn_select_callback(self, cb)[source]
set_alpn_select_callback(self, cb)[source]
set_alpn_protos(self, protocols)[source]
__getattr__(self, attr)[source]
__setattr__(self, attr, val)[source]

Implement setattr(self, name, value).

__delattr__(self, attr)[source]

Implement delattr(self, name).

class backend.globaleaks.utils.sni._ConnectionProxy(original, factory)[source]

Bases: object

A basic proxy for an OpenSSL Connection object that returns a ContextProxy wrapping the actual OpenSSL Context whenever it’s asked for.

get_context(self)[source]

A basic override of get_context to ensure that the appropriate proxy object is returned.

__getattr__(self, attr)[source]
__setattr__(self, attr, val)[source]

Implement setattr(self, name, value).

__delattr__(self, attr)[source]

Implement delattr(self, name).

class backend.globaleaks.utils.sni.SNIMap[source]

Bases: object

default_context[source]
configs_by_tid[source]
contexts_by_hostname[source]
set_default_context(self, context)[source]
load(self, tid, conf)[source]
unload(self, tid)[source]
selectContext(self, connection)[source]
serverConnectionForTLS(self, protocol)[source]
_npnAdvertiseCallbackForContext(self, context, callback)[source]
_npnSelectCallbackForContext(self, context, callback)[source]
_alpnSelectCallbackForContext(self, context, callback)[source]
_alpnProtocolsForContext(self, context, protocols)[source]