'Check that trying to use the given client certificate fails'

def bad_cert_test(self, certfile):

    certfile = os.path.join((os.path.dirname(__file__) or os.curdir), certfile)
    sock = socket.socket()
    self.addCleanup(sock.close)
    with self.assertRaises(ssl.SSLError):
        ssl.wrap_socket(sock, certfile=certfile, ssl_version=ssl.PROTOCOL_TLSv1)
