Skip to content

Commit

Permalink
[1.25] Fix testing of SSLKEYLOGFILE on AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
hodbn authored and sethmlarson committed Jul 19, 2020
1 parent b8ad351 commit cd600b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 2 additions & 8 deletions test/with_dummyserver/test_https.py
Expand Up @@ -698,16 +698,10 @@ def test_tls_protocol_name_of_socket(self):
finally:
conn.close()

@pytest.mark.skipif(
not hasattr(ssl.SSLContext, "keylog_filename"),
reason="requires OpenSSL 1.1.1+",
)
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python 3.8+")
@pytest.mark.skipif(
sys.platform == "win32",
reason="does not work reliably in Appveyor test enviroment for not yet known reasons",
)
def test_sslkeylogfile(self, tmpdir, monkeypatch):
if not hasattr(util.SSLContext, "keylog_filename"):
pytest.skip("requires OpenSSL 1.1.1+")
keylog_file = tmpdir.join("keylogfile.txt")
monkeypatch.setenv("SSLKEYLOGFILE", str(keylog_file))
with HTTPSConnectionPool(
Expand Down
5 changes: 3 additions & 2 deletions test/with_dummyserver/test_socketlevel.py
Expand Up @@ -10,8 +10,8 @@
ProtocolError,
)
from urllib3.response import httplib
from urllib3 import util
from urllib3.util import ssl_wrap_socket
from urllib3.util.ssl_ import HAS_SNI
from urllib3.util import ssl_
from urllib3.util.timeout import Timeout
from urllib3.util.retry import Retry
Expand Down Expand Up @@ -87,8 +87,9 @@ def multicookie_response_handler(listener):


class TestSNI(SocketDummyServerTestCase):
@pytest.mark.skipif(not HAS_SNI, reason="SNI-support not available")
def test_hostname_in_first_request_packet(self):
if not util.HAS_SNI:
pytest.skip("SNI-support not available")
done_receiving = Event()
self.buf = b""

Expand Down

0 comments on commit cd600b5

Please sign in to comment.