summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-08-15 23:02:22 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-08-15 23:02:22 (GMT)
commitf4c7badc028e3f389a76c293fcb6efa80e16d670 (patch)
treee4c25022fc577ed63b3802c67b7cffb82ef4d4e4 /Lib
parent968dc03f24f71c47bee4614f0bcbf53eabdc8867 (diff)
downloadcpython-f4c7badc028e3f389a76c293fcb6efa80e16d670.zip
cpython-f4c7badc028e3f389a76c293fcb6efa80e16d670.tar.gz
cpython-f4c7badc028e3f389a76c293fcb6efa80e16d670.tar.bz2
Put test_ciphers in NetworkedTests
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 9003a82..56a1b04 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -153,22 +153,6 @@ class BasicSocketTests(unittest.TestCase):
self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
(s, t))
- def test_ciphers(self):
- if not 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 can happen at instantiation or when connecting
- with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
- s.connect(remote)
-
@support.cpython_only
def test_refcycle(self):
# Issue #7943: an SSL object doesn't create reference cycles with
@@ -444,6 +428,20 @@ class NetworkedTests(unittest.TestCase):
if support.verbose:
sys.stdout.write("\nVerified certificate for svn.python.org:443 is\n%s\n" % pem)
+ def test_ciphers(self):
+ 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 can happen at instantiation or when connecting
+ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
+ s.connect(remote)
+
def test_algorithms(self):
# Issue #8484: all algorithms should be available when verifying a
# certificate.