twisted.protocols.tls.TLSMemoryBIOFactory(WrappingFactory) class documentationtwisted.protocols.tls
(View In Hierarchy)
TLSMemoryBIOFactory
adds TLS to connections.
| Method | __init__ | Create a TLSMemoryBIOFactory. | 
| Method | logPrefix | Annotate the wrapped factory's log prefix with some text indicating TLS is in use. | 
| Instance Variable | _creatorInterface | the interface which _connectionCreatoris expected to implement. (type:zope.interface.interfaces.IInterface) | 
| Instance Variable | _connectionCreator | a callable which creates an OpenSSL Connection object. (type: 1-argument callable taking TLSMemoryBIOProtocoland returningOpenSSL.SSL.Connection.) | 
| Method | _applyProtocolNegotiation | Applies ALPN/NPN protocol neogitation to the connection, if the factory supports it. | 
| Method | _createConnection | Create an OpenSSL connection and set it up good. | 
Inherited from WrappingFactory:
| Method | doStart | Make sure startFactory is called. | 
| Method | doStop | Make sure stopFactory is called. | 
| Method | startedConnecting | Called when a connection has been started. | 
| Method | clientConnectionFailed | Called when a connection has failed to connect. | 
| Method | clientConnectionLost | Called when an established connection is lost. | 
| Method | buildProtocol | Create an instance of a subclass of Protocol. | 
| Method | registerProtocol | Called by protocol to register itself. | 
| Method | unregisterProtocol | Called by protocols when they go away. | 
Inherited from Factory (via WrappingFactory, ClientFactory):
| Class Method | forProtocol | Create a factory for the given protocol. | 
| Method | startFactory | This will be called before I begin listening on a Port or Connector. | 
| Method | stopFactory | This will be called before I stop listening on all Ports/Connectors. | 
_connectionCreator
is expected to implement. (type: zope.interface.interfaces.IInterface)
  TLSMemoryBIOProtocol
and returning OpenSSL.SSL.Connection.)
  Create a TLSMemoryBIOFactory.
| Parameters | contextFactory | Configuration parameters used to create an OpenSSL connection.  In order of
preference, what you should pass here should be: 
 IOpenSSLClientConnectionCreatororIOpenSSLServerConnectionCreator,
or, for compatibility with older code, anything implementingtwisted.internet.interfaces.IOpenSSLContextFactory.
See https://twistedmatrix.com/trac/ticket/7215 for 
information on the upcoming deprecation of passing atwisted.internet.ssl.ContextFactoryhere.) | 
| isClient | Is this a factory for TLS client connections; in other words, those that 
will send a ClientHellogreeting?Trueif so,Falseotherwise.  This flag determines what interface is expected ofcontextFactory.  IfTrue,contextFactoryshould provideIOpenSSLClientConnectionCreator;
otherwise it should provideIOpenSSLServerConnectionCreator. (type:bool) | |
| wrappedFactory | A factory which will create the application-level protocol. (type: twisted.internet.interfaces.IProtocolFactory) | 
Annotate the wrapped factory's log prefix with some text indicating TLS is in use.
| Returns | (type: str) | |
Applies ALPN/NPN protocol neogitation to the connection, if the factory supports it.
| Parameters | connection | The OpenSSL connection object to have ALPN/NPN added to it. (type: OpenSSL.SSL.Connection) | 
| Returns | Nothing (type: None) | |
Create an OpenSSL connection and set it up good.
| Parameters | tlsProtocol | The protocol which is establishing the connection. (type: TLSMemoryBIOProtocol) | 
| Returns | an OpenSSL connection object for tlsProtocolto use (type:OpenSSL.SSL.Connection) | |