Go to the latest version of this document.

# ``twisted`.`words`.`protocols`.`jabber`.`xmlstream`.`TLSInitiatingInitializer``

class documentation

`class TLSInitiatingInitializer(BaseFeatureInitiatingInitializer): (source)`

Constructor: `TLSInitiatingInitializer(xs, required, configurationForTLS)`

View In Hierarchy

TLS stream initializer for the initiating entity.

It is strongly required to include this initializer in the list of initializers for an XMPP stream. By default it will try to negotiate TLS. An XMPP server may indicate that TLS is required. If TLS is not desired, set the `wanted` attribute to False instead of removing it from the list of initializers, so a proper exception `TLSRequired` can be raised.

Method | `__init__` | No summary
Method | `onFailure` | Undocumented
Method | `onProceed` | Proceed with TLS negotiation and reset the XML stream.
Method | `start` | Start TLS negotiation.
Class Variable | `feature` | Undocumented
Instance Variable | `wanted` | indicates if TLS negotiation is wanted.
Instance Variable | `_configurationForTLS` | Undocumented
Instance Variable | `_deferred` | Undocumented

Inherited from `BaseFeatureInitiatingInitializer`:

Method | `initialize` | Initiate the initialization.
Instance Variable | `required` | whether the stream feature is required to be advertized by the receiving entity.
Instance Variable | `xmlstream` | The associated XML stream

def __init__(self, xs, required=True, configurationForTLS=None): (source)
overrides `twisted.words.protocols.jabber.xmlstream.BaseFeatureInitiatingInitializer.__init__`

Parameters
xs | Undocumented
required | Undocumented

configurationForTLS:`IOpenSSLClientConnectionCreator` or `None`

An object which creates appropriately configured TLS connections. This is passed to `startTLS` on the transport and is preferably created using `twisted.internet.ssl.optionsForClientTLS`. If `None`, the default is to verify the server certificate against the trust roots as provided by the platform. See `twisted.internet._sslverify.platformTrust`.

def onFailure(self, obj): (source)

Undocumented

def onProceed(self, obj): (source)

Proceed with TLS negotiation and reset the XML stream.

def start(self): (source)
overrides `twisted.words.protocols.jabber.xmlstream.BaseFeatureInitiatingInitializer.start`

Start TLS negotiation.

This checks if the receiving entity requires TLS, the SSL library is available and uses the `required` and `wanted` instance variables to determine what to do in the various different cases.

For example, if the SSL library is not available, and wanted and required by the user, it raises an exception. However if it is not required by both parties, initialization silently succeeds, moving on to the next step.

feature = (source)
overrides `twisted.words.protocols.jabber.xmlstream.BaseFeatureInitiatingInitializer.feature`

Undocumented

wanted: `bool` = (source)

indicates if TLS negotiation is wanted.

_configurationForTLS = (source)

Undocumented

_deferred = (source)

Undocumented