'Check that connecting with a certificate not accepted by the server CA
fails.'

def test_failedCertificateVerification(self):

    onServerLost = defer.Deferred()
    onClientLost = defer.Deferred()
    self.loopback(sslverify.OpenSSLCertificateOptions(privateKey=self.sKey, certificate=self.sCert, verify=False, requireCertificate=False), sslverify.OpenSSLCertificateOptions(verify=True, requireCertificate=False, caCerts=[self.cCert]), onServerLost=onServerLost, onClientLost=onClientLost)
    d = defer.DeferredList([onClientLost, onServerLost], consumeErrors=True)
    def afterLost(result):
        ((cSuccess, cResult), (sSuccess, sResult)) = result
        self.assertFalse(cSuccess)
        self.assertFalse(sSuccess)
    return d.addCallback(afterLost)
