class documentation

class twisted.protocols.tls._ContextFactoryToConnectionFactory: (source)

View In Hierarchy

Adapter wrapping a twisted.internet.interfaces.IOpenSSLContextFactory into a IOpenSSLClientConnectionCreator or IOpenSSLServerConnectionCreator.

See https://twistedmatrix.com/trac/ticket/7215 for work that should make this unnecessary.

Method __init__ Construct a _ContextFactoryToConnectionFactory with a twisted.internet.interfaces.IOpenSSLContextFactory.
Method serverConnectionForTLS Construct an OpenSSL server connection from the wrapped old-style context factory.
Method clientConnectionForTLS Construct an OpenSSL server connection from the wrapped old-style context factory.
Instance Variable _oldStyleContextFactory Undocumented
Method _connectionForTLS Create an OpenSSL.SSL.Connection object.
def __init__(self, oldStyleContextFactory): (source)

Construct a _ContextFactoryToConnectionFactory with a twisted.internet.interfaces.IOpenSSLContextFactory.

Immediately call getContext on oldStyleContextFactory in order to force advance parameter checking, since old-style context factories don't actually check that their arguments to OpenSSL are correct.

ParametersoldStyleContextFactoryA factory that can produce contexts. (type: twisted.internet.interfaces.IOpenSSLContextFactory)
_oldStyleContextFactory = (source)

Undocumented

def _connectionForTLS(self, protocol): (source)

Create an OpenSSL.SSL.Connection object.

ParametersprotocolThe protocol initiating a TLS connection. (type: TLSMemoryBIOProtocol)
Returnsa connection (type: OpenSSL.SSL.Connection)
def serverConnectionForTLS(self, protocol): (source)

Construct an OpenSSL server connection from the wrapped old-style context factory.

ParametersprotocolThe protocol initiating a TLS connection. (type: TLSMemoryBIOProtocol)
Returnsa connection (type: OpenSSL.SSL.Connection)
NoteSince old-style context factories don't distinguish between clients and servers, this is exactly the same as _ContextFactoryToConnectionFactory.clientConnectionForTLS.
def clientConnectionForTLS(self, protocol): (source)

Construct an OpenSSL server connection from the wrapped old-style context factory.

ParametersprotocolThe protocol initiating a TLS connection. (type: TLSMemoryBIOProtocol)
Returnsa connection (type: OpenSSL.SSL.Connection)
NoteSince old-style context factories don't distinguish between clients and servers, this is exactly the same as _ContextFactoryToConnectionFactory.serverConnectionForTLS.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.