diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-10-03 21:27:05 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-10-03 21:27:05 (GMT) |
commit | 0b30a2bd27e4bb4de9606a873d69dc8063bca58c (patch) | |
tree | 28c7a3c7469d71cc9b73842aa9a0da409d1e6e08 /Lib/test/test_ssl.py | |
parent | a2e2b587c8efdd0e83ef2c911b92344d14a2f7fd (diff) | |
download | cpython-0b30a2bd27e4bb4de9606a873d69dc8063bca58c.zip cpython-0b30a2bd27e4bb4de9606a873d69dc8063bca58c.tar.gz cpython-0b30a2bd27e4bb4de9606a873d69dc8063bca58c.tar.bz2 |
also use openssl envvars to find certs on windows (closes #22449)
Patch by Christian Heimes and Alex Gaynor.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 75bb1e0..1f0e093 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1058,6 +1058,14 @@ class ContextTests(unittest.TestCase): self.assertRaises(TypeError, ctx.load_default_certs, None) self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH') + def test_load_default_certs_env(self): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + with support.EnvironmentVarGuard() as env: + env["SSL_CERT_DIR"] = CAPATH + env["SSL_CERT_FILE"] = CERTFILE + ctx.load_default_certs() + self.assertEqual(ctx.cert_store_stats(), {"crl": 0, "x509": 1, "x509_ca": 0}) + def test_create_default_context(self): ctx = ssl.create_default_context() self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23) |