mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
don't require OpenSSL SNI to pass hostname to ssl functions (#22921)
Patch by Donald Stufft.
This commit is contained in:
parent
378e15d7ab
commit
7243b574e5
16 changed files with 22 additions and 67 deletions
|
@ -12,9 +12,6 @@ try:
|
|||
import ssl
|
||||
except ImportError:
|
||||
ssl = None
|
||||
HAS_SNI = False
|
||||
else:
|
||||
from ssl import HAS_SNI
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
@ -857,7 +854,6 @@ class EventLoopTestsMixin:
|
|||
server.close()
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
def test_create_server_ssl_verify_failed(self):
|
||||
proto = MyProto(loop=self.loop)
|
||||
server, host, port = self._make_ssl_server(
|
||||
|
@ -882,7 +878,6 @@ class EventLoopTestsMixin:
|
|||
server.close()
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
|
||||
def test_create_unix_server_ssl_verify_failed(self):
|
||||
proto = MyProto(loop=self.loop)
|
||||
|
@ -909,7 +904,6 @@ class EventLoopTestsMixin:
|
|||
server.close()
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
def test_create_server_ssl_match_failed(self):
|
||||
proto = MyProto(loop=self.loop)
|
||||
server, host, port = self._make_ssl_server(
|
||||
|
@ -937,7 +931,6 @@ class EventLoopTestsMixin:
|
|||
server.close()
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
|
||||
def test_create_unix_server_ssl_verified(self):
|
||||
proto = MyProto(loop=self.loop)
|
||||
|
@ -963,7 +956,6 @@ class EventLoopTestsMixin:
|
|||
server.close()
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
def test_create_server_ssl_verified(self):
|
||||
proto = MyProto(loop=self.loop)
|
||||
server, host, port = self._make_ssl_server(
|
||||
|
|
|
@ -1408,7 +1408,7 @@ class SelectorSslTransportTests(test_utils.TestCase):
|
|||
self.assertEqual(tr._conn_lost, 1)
|
||||
self.assertEqual(1, self.loop.remove_reader_count[1])
|
||||
|
||||
@unittest.skipIf(ssl is None or not ssl.HAS_SNI, 'No SNI support')
|
||||
@unittest.skipIf(ssl is None, 'No SSL support')
|
||||
def test_server_hostname(self):
|
||||
_SelectorSslTransport(
|
||||
self.loop, self.sock, self.protocol, self.sslcontext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue