diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-03-12 23:05:53 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-03-12 23:05:53 (GMT) |
commit | cf25c5caae01b1e44793478df50456048e11f31b (patch) | |
tree | 3123f662998d4dbe70f9b8f1ad9fe838778b7ec8 /Lib/test | |
parent | d9bed99fcb744c3bb5a0d027462a667dceac9795 (diff) | |
download | cpython-cf25c5caae01b1e44793478df50456048e11f31b.zip cpython-cf25c5caae01b1e44793478df50456048e11f31b.tar.gz cpython-cf25c5caae01b1e44793478df50456048e11f31b.tar.bz2 |
use ssl.PROTOCOL_SSLv23 for maximum compatibility (closes #20896)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ssl.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 4d67fa1..5c8df8b 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -690,12 +690,15 @@ class NetworkedTests(unittest.TestCase): def test_get_server_certificate(self): with support.transient_internet("svn.python.org"): - pem = ssl.get_server_certificate(("svn.python.org", 443)) + pem = ssl.get_server_certificate(("svn.python.org", 443), + ssl.PROTOCOL_SSLv23) if not pem: self.fail("No server certificate on svn.python.org:443!") try: - pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE) + pem = ssl.get_server_certificate(("svn.python.org", 443), + ssl.PROTOCOL_SSLv23, + ca_certs=CERTFILE) except ssl.SSLError as x: #should fail if support.verbose: @@ -703,7 +706,9 @@ class NetworkedTests(unittest.TestCase): else: self.fail("Got server certificate %s for svn.python.org!" % pem) - pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=SVN_PYTHON_ORG_ROOT_CERT) + pem = ssl.get_server_certificate(("svn.python.org", 443), + ssl.PROTOCOL_SSLv23, + ca_certs=SVN_PYTHON_ORG_ROOT_CERT) if not pem: self.fail("No server certificate on svn.python.org:443!") if support.verbose: |