'When an invalid certificate containing a perfectly valid hostname is
received, the connection is aborted with an OpenSSL error.'

def test_validHostnameInvalidCertificate(self):

    (cProto, sProto, pump) = self.serviceIdentitySetup(u'valid.example.com', u'valid.example.com', validCertificate=False)
    self.assertEqual(cProto.wrappedProtocol.data, '')
    self.assertEqual(sProto.wrappedProtocol.data, '')
    cErr = cProto.wrappedProtocol.lostReason.value
    sErr = sProto.wrappedProtocol.lostReason.value
    self.assertIsInstance(cErr, SSL.Error)
    self.assertIsInstance(sErr, SSL.Error)
