diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-30 20:31:34 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-30 20:31:34 (GMT) |
commit | 6361ea2b07f126a4f4ee44196e0b1368324d6165 (patch) | |
tree | 632676475936b7552aad0b7c896579dbffcd98e2 /Lib/test/test_ssl.py | |
parent | 8028dc215cc762220c215e0576ba4bf4d1a625f5 (diff) | |
download | cpython-6361ea2b07f126a4f4ee44196e0b1368324d6165.zip cpython-6361ea2b07f126a4f4ee44196e0b1368324d6165.tar.gz cpython-6361ea2b07f126a4f4ee44196e0b1368324d6165.tar.bz2 |
Remove unstable SSL tests in the absence of ssl.OP_NO_{SSLv2,SSLv3,TLSv1}
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 0eb508d..ba1d868 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -983,6 +983,8 @@ else: """Connecting to an SSLv2 server with various client options""" if test_support.verbose: sys.stdout.write("\n") + if not hasattr(ssl, 'PROTOCOL_SSLv2'): + self.skipTest("PROTOCOL_SSLv2 needed") 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) @@ -995,14 +997,6 @@ else: """Connecting to an SSLv23 server with various client options""" if test_support.verbose: sys.stdout.write("\n") - try: - try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True) - except (ssl.SSLError, socket.error), x: - # this fails on some older versions of OpenSSL (0.9.7l, for instance) - if test_support.verbose: - sys.stdout.write( - " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n" - % str(x)) try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True) try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True) try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True) @@ -1025,8 +1019,6 @@ else: try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_REQUIRED) if hasattr(ssl, 'PROTOCOL_SSLv2'): try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False) - try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False, - client_options=ssl.OP_NO_SSLv3) try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False) @skip_if_broken_ubuntu_ssl @@ -1040,8 +1032,6 @@ else: if hasattr(ssl, 'PROTOCOL_SSLv2'): try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False) try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False) - try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False, - client_options=ssl.OP_NO_TLSv1) def test_starttls(self): """Switching from clear text to encrypted and back again.""" |