summaryrefslogtreecommitdiffstats
path: root/Lib/test/make_ssl_certs.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-11-21 22:56:13 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-11-21 22:56:13 (GMT)
commit225877917e002df4b2d87e965ddd30226aa209ec (patch)
tree490f75626736e430908c8d1550a91f91c69b7fd7 /Lib/test/make_ssl_certs.py
parente079eddf2117c0af2724fcd39df639ec60c07c64 (diff)
downloadcpython-225877917e002df4b2d87e965ddd30226aa209ec.zip
cpython-225877917e002df4b2d87e965ddd30226aa209ec.tar.gz
cpython-225877917e002df4b2d87e965ddd30226aa209ec.tar.bz2
Issue #8813: Add SSLContext.verify_flags to change the verification flags
of the context in order to enable certification revocation list (CRL) checks or strict X509 rules.
Diffstat (limited to 'Lib/test/make_ssl_certs.py')
-rw-r--r--Lib/test/make_ssl_certs.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py
index f630813..4251d55 100644
--- a/Lib/test/make_ssl_certs.py
+++ b/Lib/test/make_ssl_certs.py
@@ -28,8 +28,10 @@ req_template = """
[ CA_default ]
dir = cadir
database = $dir/index.txt
+ crlnumber = $dir/crl.txt
default_md = sha1
default_days = 3600
+ default_crl_days = 3600
certificate = pycacert.pem
private_key = pycakey.pem
serial = $dir/serial
@@ -112,6 +114,8 @@ def make_ca():
os.mkdir(TMP_CADIR)
with open(os.path.join('cadir','index.txt'),'a+') as f:
pass # empty file
+ with open(os.path.join('cadir','crl.txt'),'a+') as f:
+ r.write("00")
with open(os.path.join('cadir','index.txt.attr'),'w+') as f:
f.write('unique_subject = no')
@@ -129,6 +133,8 @@ def make_ca():
'-keyfile', 'pycakey.pem', '-days', '3650',
'-selfsign', '-extensions', 'v3_ca', '-infiles', f.name ]
check_call(['openssl'] + args)
+ args = ['ca', '-config', t.name, '-gencrl', '-out', 'revocation.crl']
+ check_call(['openssl'] + args)
if __name__ == '__main__':
os.chdir(here)