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.

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

Inherited from BaseFeatureInitiatingInitializer:

Instance Variable required whether the stream feature is required to be advertized by the receiving entity.
Instance Variable xmlstream Undocumented
Method initialize Initiate the initialization.
wanted =
indicates if TLS negotiation is wanted.
(type: bool)
feature =
Undocumented
_deferred =
Undocumented
_configurationForTLS =
Undocumented
def __init__(self, xs, required=True, configurationForTLS=None): (source)
ParametersconfigurationForTLSAn 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. (type: IOpenSSLClientConnectionCreator or None)
def onProceed(self, obj): (source)

Proceed with TLS negotiation and reset the XML stream.

def onFailure(self, obj): (source)
Undocumented
def start(self): (source)

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.

API Documentation for Twisted, generated by pydoctor at 2020-03-20 23:54:06.