summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-03-12 18:10:57 -0500
committerBenjamin Peterson <benjamin@python.org>2014-03-12 18:10:57 -0500
commit4e8c81425da5f6c7dc3f4e7b4229387eaeb73252 (patch)
treeab651723de3a720a7e36d32fba8ffccd9ea038f1 /Lib/test
parent3af35f191b567d8a54183b20098bcce33a538665 (diff)
parent71f443e352cc218ec3537568262b73e7c516b82f (diff)
downloadcpython-4e8c81425da5f6c7dc3f4e7b4229387eaeb73252.tar.gz
merge 3.3 (#20896)
Diffstat (limited to 'Lib/test')
-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 0dc04c08ea..1a2a9f0caa 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -1351,12 +1351,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:
@@ -1364,7 +1367,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: