mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-15 17:14:15 +00:00
Consolidate SSL ciphers and use them in SslTransport (#1798)
Some checks are pending
CI / Perform Lint Checks (3.14) (push) Waiting to run
CI / Python 3.11 on macos-latest (push) Blocked by required conditions
CI / Python 3.12 on macos-latest (push) Blocked by required conditions
CI / Python 3.13 on macos-latest (push) Blocked by required conditions
CI / Python 3.14 on macos-latest (push) Blocked by required conditions
CI / Python 3.11 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.12 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.13 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.14 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.11 on windows-latest (push) Blocked by required conditions
CI / Python 3.12 on windows-latest (push) Blocked by required conditions
CI / Python 3.13 on windows-latest (push) Blocked by required conditions
CI / Python 3.14 on windows-latest (push) Blocked by required conditions
CodeQL Checks / Analyze (python) (push) Waiting to run
Some checks are pending
CI / Perform Lint Checks (3.14) (push) Waiting to run
CI / Python 3.11 on macos-latest (push) Blocked by required conditions
CI / Python 3.12 on macos-latest (push) Blocked by required conditions
CI / Python 3.13 on macos-latest (push) Blocked by required conditions
CI / Python 3.14 on macos-latest (push) Blocked by required conditions
CI / Python 3.11 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.12 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.13 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.14 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.11 on windows-latest (push) Blocked by required conditions
CI / Python 3.12 on windows-latest (push) Blocked by required conditions
CI / Python 3.13 on windows-latest (push) Blocked by required conditions
CI / Python 3.14 on windows-latest (push) Blocked by required conditions
CodeQL Checks / Analyze (python) (push) Waiting to run
- Add `kasa/transports/sslcontext.py` with one shared SSL context for the https transports to avoid copies across transports. - Use it in `SslTransport`, and convert KLAP and Linkie also to use it. - Extend Python's default ciphers with the legacy suites instead of replacing accepted ciphers for future compatibility.
This commit is contained in:
11
tests/transports/test_sslcontext.py
Normal file
11
tests/transports/test_sslcontext.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import ssl
|
||||
|
||||
from kasa.transports.sslcontext import get_ssl_context
|
||||
|
||||
|
||||
async def test_ssl_context_extends_python_defaults_with_legacy_suites() -> None:
|
||||
"""Some ciphers are added on top of Python's defaults for compatibility."""
|
||||
default = {c["name"] for c in ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT).get_ciphers()}
|
||||
enabled = {c["name"] for c in (await get_ssl_context()).get_ciphers()}
|
||||
assert default <= enabled
|
||||
assert {"AES128-GCM-SHA256", "AES256-SHA"} <= enabled
|
||||
Reference in New Issue
Block a user