Backed out changeset c13398566409
This commit is contained in:
parent
5a2c04012c
commit
f31213cd65
|
@ -1351,13 +1351,12 @@ class NetworkedTests(unittest.TestCase):
|
||||||
def test_get_server_certificate(self):
|
def test_get_server_certificate(self):
|
||||||
def _test_get_server_certificate(host, port, cert=None):
|
def _test_get_server_certificate(host, port, cert=None):
|
||||||
with support.transient_internet(host):
|
with support.transient_internet(host):
|
||||||
# FIXME: force PROTOCOL_SSLv23 for workaround bug #20896
|
pem = ssl.get_server_certificate((host, port))
|
||||||
pem = ssl.get_server_certificate((host, port), ssl_version=ssl.PROTOCOL_SSLv23)
|
|
||||||
if not pem:
|
if not pem:
|
||||||
self.fail("No server certificate on %s:%s!" % (host, port))
|
self.fail("No server certificate on %s:%s!" % (host, port))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pem = ssl.get_server_certificate((host, port), ca_certs=CERTFILE, ssl_version=ssl.PROTOCOL_SSLv23)
|
pem = ssl.get_server_certificate((host, port), ca_certs=CERTFILE)
|
||||||
except ssl.SSLError as x:
|
except ssl.SSLError as x:
|
||||||
#should fail
|
#should fail
|
||||||
if support.verbose:
|
if support.verbose:
|
||||||
|
@ -1365,7 +1364,7 @@ class NetworkedTests(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
self.fail("Got server certificate %s for %s:%s!" % (pem, host, port))
|
self.fail("Got server certificate %s for %s:%s!" % (pem, host, port))
|
||||||
|
|
||||||
pem = ssl.get_server_certificate((host, port), ca_certs=cert, ssl_version=ssl.PROTOCOL_SSLv23)
|
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
|
||||||
if not pem:
|
if not pem:
|
||||||
self.fail("No server certificate on %s:%s!" % (host, port))
|
self.fail("No server certificate on %s:%s!" % (host, port))
|
||||||
if support.verbose:
|
if support.verbose:
|
||||||
|
|
Loading…
Reference in New Issue