diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-01-09 19:02:20 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-01-09 19:02:20 (GMT) |
commit | cd3d7cabef64267da43519a832a7429c1a8a15f9 (patch) | |
tree | ad0670eb2de57b4fd18993de461b60dd7e2908ac /Lib/test | |
parent | 1064a13bb05db8f6e86a3fe780f969fa2919a1d1 (diff) | |
download | cpython-cd3d7cabef64267da43519a832a7429c1a8a15f9.zip cpython-cd3d7cabef64267da43519a832a7429c1a8a15f9.tar.gz cpython-cd3d7cabef64267da43519a832a7429c1a8a15f9.tar.bz2 |
Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly asked for.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ssl.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 104a1ed..1dd6829 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -534,9 +534,7 @@ class ContextTests(unittest.TestCase): @skip_if_broken_ubuntu_ssl def test_options(self): ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) - # OP_ALL is the default value - self.assertEqual(ssl.OP_ALL, ctx.options) - ctx.options |= ssl.OP_NO_SSLv2 + # OP_ALL | OP_NO_SSLv2 is the default value self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2, ctx.options) ctx.options |= ssl.OP_NO_SSLv3 @@ -1585,7 +1583,7 @@ else: try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True) try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL) try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED) - try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True) + try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False) try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False) try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False) # SSLv23 client with specific SSL options @@ -1593,9 +1591,9 @@ else: # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False, client_options=ssl.OP_NO_SSLv2) - try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True, + try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False, client_options=ssl.OP_NO_SSLv3) - try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True, + try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False, client_options=ssl.OP_NO_TLSv1) @skip_if_broken_ubuntu_ssl |