mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
merge 3.4 (#22449)
This commit is contained in:
commit
8b9cfa1066
3 changed files with 12 additions and 2 deletions
|
|
@ -1095,6 +1095,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue