local-server/vendor/github.com/cloudflare/cfssl/testdata/test.py
Mikaël Cluseau 4d889632f6 vendor
2018-06-17 18:32:44 +11:00

13 lines
319 B
Python

import sys
from m2ext import SSL
from M2Crypto import X509
print "Validating certificate %s using CApath %s" % (sys.argv[1], sys.argv[2])
cert = X509.load_cert(sys.argv[1])
ctx = SSL.Context()
ctx.load_verify_locations(capath=sys.argv[2])
if ctx.validate_certificate(cert):
print "valid"
else:
print "invalid"