'Create and return a new SSH connection which has been secured and on
which authentication has already happened.
@return: A L{Deferred} which fires with the ready-to-use connection or
with a failure if something prevents the connection from being
setup, secured, or authenticated.'

def secureConnection(self):

    protocol = _CommandTransport(self)
    ready = protocol.connectionReady
    sshClient = TCP4ClientEndpoint(self.reactor, nativeString(self.hostname), self.port)
    d = connectProtocol(sshClient, protocol)
    d.addCallback((lambda ignored: ready))
    return d
