Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`tls``

module documentation
(source)

Implementation of a TLS transport (`ISSLTransport`) as an `IProtocol` layered on top of any `ITransport` implementation, based on OpenSSL's memory BIO features.

`TLSMemoryBIOFactory` is a `WrappingFactory` which wraps protocols created by the factory it wraps with `TLSMemoryBIOProtocol`. `TLSMemoryBIOProtocol` intercedes between the underlying transport and the wrapped protocol to implement SSL and TLS. Typical usage of this module looks like this:

        from twisted.protocols.tls import TLSMemoryBIOFactory
        from twisted.internet.protocol import ServerFactory
        from twisted.internet.ssl import PrivateCertificate
        from twisted.internet import reactor

        from someapplication import ApplicationProtocol

        serverFactory = ServerFactory()
        serverFactory.protocol = ApplicationProtocol
        certificate = PrivateCertificate.loadPEM(certPEMData)
        contextFactory = certificate.options()
        tlsFactory = TLSMemoryBIOFactory(contextFactory, False, serverFactory)
        reactor.listenTCP(12345, tlsFactory)
        reactor.run()

This API offers somewhat more flexibility than `twisted.internet.interfaces.IReactorSSL`; for example, a `TLSMemoryBIOProtocol` instance can use another instance of `TLSMemoryBIOProtocol` as its transport, yielding TLS over TLS - useful to implement onion routing. It can also be used to run TLS over unusual transports, such as UNIX sockets and stdio.

Class | `TLSMemoryBIOFactory` | `TLSMemoryBIOFactory` adds TLS to connections.
Class | `TLSMemoryBIOProtocol` | `TLSMemoryBIOProtocol` is a protocol wrapper which uses OpenSSL via a memory BIO to encrypt bytes written to it before sending them on to the underlying transport and decrypts bytes received from the underlying transport before delivering them to the wrapped protocol.
Class | `_ContextFactoryToConnectionFactory` | Adapter wrapping a `twisted.internet.interfaces.IOpenSSLContextFactory` into a `IOpenSSLClientConnectionCreator` or `IOpenSSLServerConnectionCreator`.
Class | `_ProducerMembrane` | Stand-in for producer registered with a `TLSMemoryBIOProtocol` transport.