'When the connection is secure, start the authentication process.'

def connectionSecure(self):

    self._state = 'AUTHENTICATING'
    command = _ConnectionReady(self.connectionReady)
    self._userauth = _UserAuth(self.creator.username, command)
    self._userauth.password = self.creator.password
    if self.creator.keys:
        self._userauth.keys = list(self.creator.keys)
    if (self.creator.agentEndpoint is not None):
        d = self._userauth.connectToAgent(self.creator.agentEndpoint)
    else:
        d = succeed(None)
    def maybeGotAgent(ignored):
        self.requestService(self._userauth)
    d.addBoth(maybeGotAgent)
