mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Don't fail in test_ssl when svn.python.org is unavailable
This commit is contained in:
parent
a71bfc46d0
commit
942d554c5b
1 changed files with 12 additions and 11 deletions
|
@ -156,18 +156,19 @@ class BasicSocketTests(unittest.TestCase):
|
|||
if not test_support.is_resource_enabled('network'):
|
||||
return
|
||||
remote = ("svn.python.org", 443)
|
||||
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
|
||||
cert_reqs=ssl.CERT_NONE, ciphers="ALL")
|
||||
s.connect(remote)
|
||||
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
|
||||
cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
|
||||
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"):
|
||||
with test_support.transient_internet(remote[0]):
|
||||
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
|
||||
cert_reqs=ssl.CERT_NONE, ciphers="ALL")
|
||||
s.connect(remote)
|
||||
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
|
||||
cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
|
||||
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
|
||||
def test_refcycle(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue