summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2018-06-11 22:59:45 (GMT)
committerNed Deily <nad@python.org>2018-06-11 22:59:45 (GMT)
commitef24b6c54d40e7820456873a6eab6ef57d2bd0db (patch)
tree453f2603e01d16c2be2e5b280e0fc70c6061bbb5 /Lib/test
parent4b704f29f5a0b6f6d7bd67468ed004bd3a96855d (diff)
downloadcpython-ef24b6c54d40e7820456873a6eab6ef57d2bd0db.zip
cpython-ef24b6c54d40e7820456873a6eab6ef57d2bd0db.tar.gz
cpython-ef24b6c54d40e7820456873a6eab6ef57d2bd0db.tar.bz2
bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were misleading and partly wrong. It fails to explain that OpenSSL behaves differently in client and server mode. Also OpenSSL does validate the cert chain everytime. With SSL_VERIFY_NONE a validation error is not fatal in client mode and does not request a client cert in server mode. Also discourage people from using CERT_OPTIONAL in client mode.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_ssl.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 73d3e3b..3d6ae02 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -4074,7 +4074,9 @@ class ThreadedTests(unittest.TestCase):
self.assertTrue(session)
with self.assertRaises(TypeError) as e:
s.session = object
- self.assertEqual(str(e.exception), 'Value is not a SSLSession.')
+ self.assertEqual(
+ str(e.exception), 'Value is not an SSLSession.'
+ )
with client_context.wrap_socket(socket.socket(),
server_hostname=hostname) as s: