]> granicus.if.org Git - python/commitdiff
Issue #20896: Workaround the bug temporarely to fix buildbots
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 12 Mar 2014 11:41:44 +0000 (12:41 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 12 Mar 2014 11:41:44 +0000 (12:41 +0100)
Lib/test/test_ssl.py

index 0dc04c08eaefb887b0135bbf4d81510e34d8b56c..ad0689c469d0246c68b4ea94afcf6f5edc6e384b 100644 (file)
@@ -1351,12 +1351,13 @@ class NetworkedTests(unittest.TestCase):
     def test_get_server_certificate(self):
         def _test_get_server_certificate(host, port, cert=None):
             with support.transient_internet(host):
-                pem = ssl.get_server_certificate((host, port))
+                # FIXME: force PROTOCOL_SSLv23 for workaround bug #20896
+                pem = ssl.get_server_certificate((host, port), ssl_version=ssl.PROTOCOL_SSLv23)
                 if not pem:
                     self.fail("No server certificate on %s:%s!" % (host, port))
 
                 try:
-                    pem = ssl.get_server_certificate((host, port), ca_certs=CERTFILE)
+                    pem = ssl.get_server_certificate((host, port), ca_certs=CERTFILE, ssl_version=ssl.PROTOCOL_SSLv23)
                 except ssl.SSLError as x:
                     #should fail
                     if support.verbose:
@@ -1364,7 +1365,7 @@ class NetworkedTests(unittest.TestCase):
                 else:
                     self.fail("Got server certificate %s for %s:%s!" % (pem, host, port))
 
-                pem = ssl.get_server_certificate((host, port), ca_certs=cert)
+                pem = ssl.get_server_certificate((host, port), ca_certs=cert, ssl_version=ssl.PROTOCOL_SSLv23)
                 if not pem:
                     self.fail("No server certificate on %s:%s!" % (host, port))
                 if support.verbose: