diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-10-03 22:17:30 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-10-03 22:17:30 (GMT) |
commit | 91b62c4a8a87100094b4167d2319e85159b6f4a5 (patch) | |
tree | 83ae620304dffea58018c6f2d46bfd7e14a6db1b /Lib/test | |
parent | 8b9cfa10662c7712f7685f4bc376ab65c119589b (diff) | |
parent | 91244e01bbe0dcd1a1183ad4e80cd6cb33b553de (diff) | |
download | cpython-91b62c4a8a87100094b4167d2319e85159b6f4a5.zip cpython-91b62c4a8a87100094b4167d2319e85159b6f4a5.tar.gz cpython-91b62c4a8a87100094b4167d2319e85159b6f4a5.tar.bz2 |
merge 3.4
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ssl.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 076e1a9..f1a9efb 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1095,6 +1095,7 @@ class ContextTests(unittest.TestCase): self.assertRaises(TypeError, ctx.load_default_certs, None) self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH') + @unittest.skipIf(sys.platform == "win32", "not-Windows specific") def test_load_default_certs_env(self): ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) with support.EnvironmentVarGuard() as env: @@ -1103,6 +1104,20 @@ class ContextTests(unittest.TestCase): ctx.load_default_certs() self.assertEqual(ctx.cert_store_stats(), {"crl": 0, "x509": 1, "x509_ca": 0}) + @unittest.skipUnless(sys.platform == "win32", "Windows specific") + def test_load_default_certs_env_windows(self): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + ctx.load_default_certs() + stats = ctx.cert_store_stats() + + 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() + stats["x509"] += 1 + self.assertEqual(ctx.cert_store_stats(), stats) + def test_create_default_context(self): ctx = ssl.create_default_context() self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23) |