'When a certificate containing an invalid hostname is received from the
server, the connection is immediately dropped.'

def test_invalidHostname(self):

    (cProto, sProto, pump) = self.serviceIdentitySetup(u'wrong-host.example.com', u'correct-host.example.com')
    self.assertEqual(cProto.wrappedProtocol.data, '')
    self.assertEqual(sProto.wrappedProtocol.data, '')
    cErr = cProto.wrappedProtocol.lostReason.value
    sErr = sProto.wrappedProtocol.lostReason.value
    self.assertIsInstance(cErr, VerificationError)
    self.assertIsInstance(sErr, ConnectionClosed)
