mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not PROTOCOL_SSLv3, for maximum compatibility.
This commit is contained in:
parent
0fba0c3ebf
commit
94a5b663bf
4 changed files with 10 additions and 6 deletions
|
@ -1371,14 +1371,12 @@ 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),
|
||||
ssl.PROTOCOL_SSLv23)
|
||||
pem = ssl.get_server_certificate((host, port))
|
||||
if not pem:
|
||||
self.fail("No server certificate on %s:%s!" % (host, port))
|
||||
|
||||
try:
|
||||
pem = ssl.get_server_certificate((host, port),
|
||||
ssl.PROTOCOL_SSLv23,
|
||||
ca_certs=CERTFILE)
|
||||
except ssl.SSLError as x:
|
||||
#should fail
|
||||
|
@ -1388,7 +1386,6 @@ class NetworkedTests(unittest.TestCase):
|
|||
self.fail("Got server certificate %s for %s:%s!" % (pem, host, port))
|
||||
|
||||
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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue