Commit 942d554c authored by Antoine Pitrou's avatar Antoine Pitrou

Don't fail in test_ssl when svn.python.org is unavailable

parent a71bfc46
...@@ -156,18 +156,19 @@ class BasicSocketTests(unittest.TestCase): ...@@ -156,18 +156,19 @@ class BasicSocketTests(unittest.TestCase):
if not test_support.is_resource_enabled('network'): if not test_support.is_resource_enabled('network'):
return return
remote = ("svn.python.org", 443) remote = ("svn.python.org", 443)
s = ssl.wrap_socket(socket.socket(socket.AF_INET), with test_support.transient_internet(remote[0]):
cert_reqs=ssl.CERT_NONE, ciphers="ALL") s = ssl.wrap_socket(socket.socket(socket.AF_INET),
s.connect(remote) cert_reqs=ssl.CERT_NONE, ciphers="ALL")
s = ssl.wrap_socket(socket.socket(socket.AF_INET), s.connect(remote)
cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") s = ssl.wrap_socket(socket.socket(socket.AF_INET),
s.connect(remote) cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
# Error checking occurs when connecting, because the SSL context
# isn't created before.
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
s.connect(remote) s.connect(remote)
# Error checking occurs when connecting, because the SSL context
# isn't created before.
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
s.connect(remote)
@test_support.cpython_only @test_support.cpython_only
def test_refcycle(self): def test_refcycle(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment