class documentation

class StartTLS(Command): (source)

View In Hierarchy

Use, or subclass, me to implement a command that starts TLS.

Callers of StartTLS may pass several special arguments, which affect the TLS negotiation:

  • tls_localCertificate: This is a twisted.internet.ssl.PrivateCertificate which will be used to secure the side of the connection it is returned on.
  • tls_verifyAuthorities: This is a list of twisted.internet.ssl.Certificate objects that will be used as the certificate authorities to verify our peer's certificate.

Each of those special parameters may also be present as a key in the response dictionary.

Method __init__ Create a StartTLS command. (This is private. Use AMP.callRemote.)
Class Variable arguments Undocumented
Class Variable response Undocumented
Instance Variable authorities Undocumented
Instance Variable certificate Undocumented
Method _do​Command When a StartTLS command is sent, prepare to start TLS, but don't actually do it; wait for the acknowledgement, then initiate the TLS handshake.

Inherited from Command:

Class __metaclass__ Metaclass hack to establish reverse-mappings for 'errors' and 'fatalErrors' as class vars.
Class Method make​Arguments Serialize a mapping of arguments using this Command's argument schema.
Class Method make​Response Serialize a mapping of arguments using this Command's response schema.
Class Method parse​Arguments Parse a mapping of serialized arguments using this Command's argument schema.
Class Method parse​Response Parse a mapping of serialized arguments using this Command's response schema.
Class Method responder Declare a method to be a responder for a particular command.
Class Variable command​Type The type of Box used to issue commands; useful only for protocol-modifying behavior like startTLS or protocol switching. Defaults to a plain vanilla Box.
Class Variable errors A mapping of subclasses of Exception to wire-protocol tags for errors represented as strs. Responders which raise keys from this dictionary will have the error translated to the corresponding tag on the wire. Invokers which receive Deferreds from invoking this command with BoxDispatcher.callRemote will potentially receive Failures with keys from this mapping as their value. This mapping is inherited; if you declare a command which handles FooError as 'FOO_ERROR', then subclass it and specify BarError as 'BAR_ERROR', responders to the subclass may raise either FooError or BarError, and invokers must be able to deal with either of those exceptions.
Class Variable extra Undocumented
Class Variable fatal​Errors like 'errors', but errors in this list will always terminate the connection, despite being of a recognizable error type.
Class Variable response​Type The type of Box used to respond to this command; only useful for protocol-modifying behavior like startTLS or protocol switching. Defaults to a plain vanilla Box.
Instance Variable requires​Answer a boolean; defaults to True. Set it to False on your subclass if you want callRemote to return None. Note: this is a hint only to the client side of the protocol. The return-type of a command responder method must always be a dictionary adhering to the contract specified by response, because clients are always free to request a response if they want one.
Instance Variable structured Undocumented
def __init__(self, *, tls_localCertificate=None, tls_verifyAuthorities=None, **kw): (source)
Create a StartTLS command. (This is private. Use AMP.callRemote.)
Parameters
tls_local​Certificatethe PrivateCertificate object to use to secure the connection. If it's None, or unspecified, an ephemeral DH key is used instead.
tls_verify​Authoritiesa list of Certificate objects which represent root certificates to verify our peer with.
**kwUndocumented
arguments = (source)
authorities = (source)

Undocumented

certificate = (source)

Undocumented

def _doCommand(self, proto): (source)
When a StartTLS command is sent, prepare to start TLS, but don't actually do it; wait for the acknowledgement, then initiate the TLS handshake.