[Python-checkins] cpython (2.7): Remove unstable SSL tests in the absence of ssl.OP_NO_{SSLv2,SSLv3,TLSv1}

antoine.pitrou python-checkins at python.org
Sun Oct 30 21:35:47 CET 2011


http://hg.python.org/cpython/rev/5a080ebd311c
changeset:   73220:5a080ebd311c
branch:      2.7
parent:      73211:3bda54275817
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Oct 30 21:31:34 2011 +0100
summary:
  Remove unstable SSL tests in the absence of ssl.OP_NO_{SSLv2,SSLv3,TLSv1}

files:
  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
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -983,6 +983,8 @@
             """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 @@
             """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 @@
             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 @@
             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."""

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list