Skip to content

Commit aca206f

Browse files
Fix backwards compatibility with ssl (#8098)
Fixes #8097. --------- Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
1 parent f3aeb9a commit aca206f

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

Diff for: CHANGES/8097.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8098.bugfix.rst

Diff for: CHANGES/8098.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed backwards compatibility breakage of ``ssl`` parameter when set outside of
2+
``ClientSession`` (e.g. directly in ``TCPConnector``) -- by :user:`Dreamsorcerer`.

Diff for: aiohttp/client_reqrep.py

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def _merge_ssl_params(
159159
ssl_context: Optional["SSLContext"],
160160
fingerprint: Optional[bytes],
161161
) -> Union["SSLContext", bool, Fingerprint]:
162+
if ssl is None:
163+
ssl = True # Double check for backwards compatibility
162164
if verify_ssl is not None and not verify_ssl:
163165
warnings.warn(
164166
"verify_ssl is deprecated, use ssl=False instead",

Diff for: tests/test_connector.py

+5
Original file line numberDiff line numberDiff line change
@@ -2249,6 +2249,11 @@ async def test_default_use_dns_cache() -> None:
22492249
assert conn.use_dns_cache
22502250

22512251

2252+
async def test_ssl_none() -> None:
2253+
conn = aiohttp.TCPConnector(ssl=None)
2254+
assert conn._ssl is True
2255+
2256+
22522257
async def test_resolver_not_called_with_address_is_ip(loop) -> None:
22532258
resolver = mock.MagicMock()
22542259
connector = aiohttp.TCPConnector(resolver=resolver)

0 commit comments

Comments
 (0)