diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-11-23 23:06:39 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-11-23 23:06:39 (GMT) |
commit | f9284ae8ede5b8977248a4259eee0cd81a100c16 (patch) | |
tree | b3430fd55e6b76ee01dfd6ac4a0baa52de7b7a3a /Lib/test/test_ssl.py | |
parent | f1a3240ba86408a2cdb88a2bfa38a2dce1f4ed9c (diff) | |
parent | 7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b (diff) | |
download | cpython-f9284ae8ede5b8977248a4259eee0cd81a100c16.zip cpython-f9284ae8ede5b8977248a4259eee0cd81a100c16.tar.gz cpython-f9284ae8ede5b8977248a4259eee0cd81a100c16.tar.bz2 |
merge 3.4 (#22921)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index aa17317..06705b2 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1428,11 +1428,8 @@ class NetworkedTests(unittest.TestCase): # Same with a server hostname s = ctx.wrap_socket(socket.socket(socket.AF_INET), server_hostname="svn.python.org") - if ssl.HAS_SNI: - s.connect(("svn.python.org", 443)) - s.close() - else: - self.assertRaises(ValueError, s.connect, ("svn.python.org", 443)) + s.connect(("svn.python.org", 443)) + s.close() # This should fail because we have no verification certs ctx.verify_mode = ssl.CERT_REQUIRED s = ctx.wrap_socket(socket.socket(socket.AF_INET)) @@ -1696,12 +1693,8 @@ class NetworkedBIOTests(unittest.TestCase): ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ctx.verify_mode = ssl.CERT_REQUIRED ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT) - if ssl.HAS_SNI: - ctx.check_hostname = True - sslobj = ctx.wrap_bio(incoming, outgoing, False, 'svn.python.org') - else: - ctx.check_hostname = False - sslobj = ctx.wrap_bio(incoming, outgoing, False) + ctx.check_hostname = True + sslobj = ctx.wrap_bio(incoming, outgoing, False, 'svn.python.org') self.assertIs(sslobj._sslobj.owner, sslobj) self.assertIsNone(sslobj.cipher()) self.assertRaises(ValueError, sslobj.getpeercert) @@ -2283,7 +2276,6 @@ else: cert = s.getpeercert() self.assertTrue(cert, "Can't get peer certificate.") - @needs_sni def test_check_hostname(self): if support.verbose: sys.stdout.write("\n") |