openssl - How can I verify an X509 certificate in python including a CRL check? -
i'm trying verify x509 certificate using python. in particular need check crls when it.
now, can use m2crypto this, can't find option corresponding openssl's -crl_check or -crl_check_all.
alternatively, use pipe , call openssl directly:
p1 = popen(["openssl", "verify", "-capath", capath, "-crl_check_all"], stdin = pipe, stdout = pipe, stderr = pipe) message, error = p1.communicate(certificate) exit_code = p1.returncode
however, seems openssl verify returns exit code 0, have compare strings somehow tell if verification successful, i'd prefer not do.
am missing simple here?
thanks.
ok, i've done this:
p1 = popen(["openssl", "verify", "-capath", capath, "-crl_check_all"], stdin = pipe, stdout = pipe, stderr = pipe) message, error = p1.communicate(certificate) verified = ("ok" in message , not "error" in message)
it's not have chosen. has passed tests, i'm not work. don't know c enough read openssl source code , verify it.
if can find situation fail, please comment.
Comments
Post a Comment