'Verify that starting TLS and succeeding at handshaking sends all the
notifications to all the right places.'

def test_startingTLS(self):

    (cli, svr, p) = connectedServerAndClient(ServerClass=SecurableProto, ClientClass=SecurableProto)
    okc = OKCert()
    svr.certFactory = (lambda : okc)
    cli.callRemote(amp.StartTLS, tls_localCertificate=okc, tls_verifyAuthorities=[PretendRemoteCertificateAuthority()])
    L = []
    cli.callRemote(SecuredPing).addCallback(L.append)
    p.flush()
    self.assertEqual(okc.verifyCount, 2)
    L = []
    cli.callRemote(SecuredPing).addCallback(L.append)
    p.flush()
    self.assertEqual(L[0], {'pinged': True})
