Go to the latest version of this document.

# ``twisted`.`protocols`.`_tls_legacy``

module documentation
(source)

Handler for the various legacy things that a `contextFactory` can be.

Exception | `LegacyContextFactoryWarning` | You should be using a newer TLS context configuration interface.
Function | `older` | Compatibility shim for `IOpenSSLContextFactory.getContext`-style method to create(Client/Server)Creator.
Function | `oldest` | Comptibility shim that does largely the same thing as `older` but for things that don't even properly implement the old-style interface; check explicitly for the method and try to provide a useful assert if the object is just the wrong type rather than simply using an older API.
Type Alias | `SingleArgFactory` | Undocumented
Type Alias | `SomeConnectionCreator` | Undocumented
Function | `_convertToAppropriateFactory` | Upgrade a connection creator / context-factory-ish object into something with a signature like the most recent interface for building OpenSSL connection objects (i.e. like the methods on `IOpenSSLClientConnectionCreator`...

def older(olderMethod: `Callable[[], Context]`) -> `SingleArgFactory`: (source)

Compatibility shim for `IOpenSSLContextFactory.getContext`-style method to create(Client/Server)Creator.

def oldest(isClient: `bool`, creator: `object`) -> `SingleArgFactory`: (source)

Comptibility shim that does largely the same thing as `older` but for things that don't even properly implement the old-style interface; check explicitly for the method and try to provide a useful assert if the object is just the wrong type rather than simply using an older API.

SingleArgFactory = (source)

Undocumented

Value

    Callable[[TLSMemoryBIOProtocol], Connection]

SomeConnectionCreator = (source)

Undocumented

Value

    IOpenSSLContextFactory | IOpenSSLClientConnectionCreator | IOpenSSLServerConnectionCreator

def _convertToAppropriateFactory(isClient: `bool`, creator: `SomeConnectionCreator`) -> `SingleArgFactory`: (source)

Upgrade a connection creator / context-factory-ish object into something with a signature like the most recent interface for building OpenSSL connection objects (i.e. like the methods on `IOpenSSLClientConnectionCreator` and `IOpenSSLServerConnectionCreator`), accounting for all the various interfaces older versions of Twisted used for context configuration.