summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-03-12 11:41:44 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-03-12 11:41:44 (GMT)
commit5a2c04012c62cba18df17e084d8668f1f2ecac4c (patch)
tree6ebd5c6ec4378b409b61f211f6e003d434e29332
parenta0fe1f74f928bec969dad25e8dc97b560748b182 (diff)
downloadcpython-5a2c04012c62cba18df17e084d8668f1f2ecac4c.zip
cpython-5a2c04012c62cba18df17e084d8668f1f2ecac4c.tar.gz
cpython-5a2c04012c62cba18df17e084d8668f1f2ecac4c.tar.bz2
Issue #20896: Workaround the bug temporarely to fix buildbots
-rw-r--r--Lib/test/test_ssl.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 0dc04c0..ad0689c 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -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: