Ticket #3371: test_tls.patch

File test_tls.patch, 917 bytes (added by exarkun, 5 years ago)
  • twisted/internet/test/test_tls.py

     
    1818try:
    1919    from OpenSSL.crypto import FILETYPE_PEM
    2020except ImportError:
    21     FILETYPE_PEM = None
     21    tls = FILETYPE_PEM = None
    2222else:
    2323    from twisted.internet.ssl import PrivateCertificate, KeyPair
    2424    from twisted.internet.ssl import ClientContextFactory
     25    try:
     26        from twisted.protocols import tls
     27    except ImportError:
     28        tls = None
    2529
    2630
    2731
     
    3236    if FILETYPE_PEM is None:
    3337        skip = "OpenSSL is unavailable"
    3438
    35     if platform.isWindows():
     39    if platform.isWindows() and tls is None:
    3640        msg = (
    3741            "For some reason, these reactors don't deal with SSL "
    3842            "disconnection correctly on Windows.  See #3371.")