mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
add check_hostname arg to ssl._create_stdlib_context()
This commit is contained in:
parent
a5768f7292
commit
a02c69a73b
2 changed files with 5 additions and 2 deletions
|
@ -1032,9 +1032,11 @@ class ContextTests(unittest.TestCase):
|
|||
self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
|
||||
|
||||
ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1,
|
||||
cert_reqs=ssl.CERT_REQUIRED)
|
||||
cert_reqs=ssl.CERT_REQUIRED,
|
||||
check_hostname=True)
|
||||
self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
|
||||
self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
|
||||
self.assertTrue(ctx.check_hostname)
|
||||
self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
|
||||
|
||||
ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue