adds verify_mode to context

This commit is contained in:
Moisés Guimarães
2016-12-05 19:15:08 -03:00
parent 8eec3cb874
commit 368f2baf88
4 changed files with 50 additions and 13 deletions

View File

@@ -125,6 +125,13 @@ class TestSSLContext(unittest.TestCase):
def test_context_creation(self):
self.assertIsNotNone(self.ctx)
self.assertEqual(self.ctx.verify_mode, self.provider.CERT_NONE)
self.ctx.verify_mode = self.provider.CERT_OPTIONAL
self.assertEqual(self.ctx.verify_mode, self.provider.CERT_OPTIONAL)
self.ctx.verify_mode = self.provider.CERT_REQUIRED
self.assertEqual(self.ctx.verify_mode, self.provider.CERT_REQUIRED)
def test_load_cert_chain_raises(self):
self.assertRaises(TypeError, self.ctx.load_cert_chain, None)