mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
expose X509_V_FLAG_TRUSTED_FIRST
This commit is contained in:
parent
fdb1971587
commit
990fcaac3c
3 changed files with 18 additions and 5 deletions
|
|
@ -710,8 +710,9 @@ class ContextTests(unittest.TestCase):
|
|||
"verify_flags need OpenSSL > 0.9.8")
|
||||
def test_verify_flags(self):
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
||||
# default value by OpenSSL
|
||||
self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
|
||||
# default value
|
||||
tf = getattr(ssl, "VERIFY_X509_TRUSTED_FIRST", 0)
|
||||
self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT | tf)
|
||||
ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF
|
||||
self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_LEAF)
|
||||
ctx.verify_flags = ssl.VERIFY_CRL_CHECK_CHAIN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue