def METHOD_NAME(self, cert):
    """ check if cert is valid according to openssl"""
    cmd = [self.openssl, "x509", "-inform", "pem", "-checkend", "0", "-noout"]
    # print("D: is_valid_cert %r" % cmd)
    proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    stdout, stderr = proc.communicate(cert)
    # print("out: %s; err:%s; ret:%i" % (stdout, stderr, proc.returncode))
    return proc.returncode == 0