mirror of
https://github.com/python/cpython.git
synced 2024-12-04 23:34:42 +08:00
test_imaplib: skip check_hostname test when SNI is not available
This commit is contained in:
parent
e7945d76ff
commit
aab99fdd65
@ -18,6 +18,9 @@ try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
ssl = None
|
||||
HAS_SNI = False
|
||||
else:
|
||||
from ssl import HAS_SNI
|
||||
|
||||
CERTFILE = None
|
||||
CAFILE = None
|
||||
@ -349,6 +352,7 @@ class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
|
||||
imap_class = IMAP4_SSL
|
||||
|
||||
@reap_threads
|
||||
@unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
|
||||
def test_ssl_verified(self):
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
|
||||
ssl_context.verify_mode = ssl.CERT_REQUIRED
|
||||
|
Loading…
Reference in New Issue
Block a user