summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-03-12 23:10:47 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-03-12 23:10:47 (GMT)
commitd0fc83d5ebf860664ab2156549d3eb98a50212cd (patch)
treefad79f2a88113fd44bad4f80ea90b10b346f0661
parentf993399c40389cbe3e32d859eae71b46ca263035 (diff)
parentcf25c5caae01b1e44793478df50456048e11f31b (diff)
downloadcpython-d0fc83d5ebf860664ab2156549d3eb98a50212cd.zip
cpython-d0fc83d5ebf860664ab2156549d3eb98a50212cd.tar.gz
cpython-d0fc83d5ebf860664ab2156549d3eb98a50212cd.tar.bz2
merge 3.2 (#20896)
-rw-r--r--Lib/test/test_ssl.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 9fc6027..e52a71c 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -964,12 +964,15 @@ 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))
+ pem = ssl.get_server_certificate((host, port),
+ 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),
+ ssl.PROTOCOL_SSLv23,
+ ca_certs=CERTFILE)
except ssl.SSLError as x:
#should fail
if support.verbose:
@@ -977,7 +980,9 @@ 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),
+ ssl.PROTOCOL_SSLv23,
+ ca_certs=cert)
if not pem:
self.fail("No server certificate on %s:%s!" % (host, port))
if support.verbose: