'Verify that starting TLS and failing on both sides at handshaking sends
notifications to all the right places and terminates the connection.'

def test_negotiationFailed(self):

    badCert = GrumpyCert()
    (cli, svr, p) = connectedServerAndClient(ServerClass=SecurableProto, ClientClass=SecurableProto)
    svr.certFactory = (lambda : badCert)
    cli.callRemote(amp.StartTLS, tls_localCertificate=badCert)
    p.flush()
    self.assertEqual(badCert.verifyCount, 2)
    d = cli.callRemote(SecuredPing)
    p.flush()
    self.assertFailure(d, iosim.NativeOpenSSLError)
