Skip to content

Commit 0307301

Browse files
entomindflayer
authored andcommitted
Support 'no verify' SSL mode
aiohttp calls 'set_default_verify_paths' on the SSL context object https://github.com/aio-libs/aiohttp/blob/v3.9.1/aiohttp/connector.py#L935
1 parent c634dc5 commit 0307301

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

mocket/mocket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class FakeSSLContext(SuperFakeSSLContext):
8585
"load_verify_locations",
8686
"set_alpn_protocols",
8787
"set_ciphers",
88+
"set_default_verify_paths",
8889
)
8990
sock = None
9091
post_handshake_auth = None

tests/tests38/test_http_aiohttp.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ async def test_https_session(self):
8181

8282
self.assertEqual(len(Mocket.request_list()), 2)
8383

84+
@async_mocketize
85+
async def test_no_verify(self):
86+
Entry.single_register(Entry.GET, self.target_url, status=404)
87+
88+
async with aiohttp.ClientSession(timeout=self.timeout) as session:
89+
async with session.get(self.target_url, ssl=False) as get_response:
90+
assert get_response.status == 404
91+
8492
@async_httprettified
8593
async def test_httprettish_session(self):
8694
HTTPretty.register_uri(

0 commit comments

Comments
 (0)