Skip to content

fix: guard TLS 1.3 minimum-version behind capability probe#475

Open
aj-nt wants to merge 1 commit into
deedy5:mainfrom
aj-nt:fix/tls13-capability-guard
Open

fix: guard TLS 1.3 minimum-version behind capability probe#475
aj-nt wants to merge 1 commit into
deedy5:mainfrom
aj-nt:fix/tls13-capability-guard

Conversation

@aj-nt

@aj-nt aj-nt commented Jun 21, 2026

Copy link
Copy Markdown

fix: guard TLS 1.3 minimum-version behind capability probe

LibreSSL (shipped with macOS system Python) does not support TLS 1.3.
The random SSL-context pool unconditionally included a command that sets
minimum_version = TLSv1_3, which raises ValueError: Unsupported protocol version on LibreSSL ~25% of the time.

Add a _tls13_supported() probe that tests whether the platform can
actually set TLS 1.3 as a minimum version, and only include that command
in the random pool when the probe passes. The probe runs once at import
time and caches the result in _TLS13_OK.

On OpenSSL (Linux, Homebrew Python, venvs): TLS 1.3 command is included
as before — full anti-fingerprinting surface preserved.

On LibreSSL (macOS system Python): TLS 1.3 command is excluded — no
crashes, still 3 randomization options (no-op, TLS 1.2 max, disable
tickets).

LibreSSL (shipped with macOS system Python) does not support TLS 1.3.
The random SSL-context pool unconditionally included a command that sets
`minimum_version = TLSv1_3`, which raises `ValueError: Unsupported
protocol version` on LibreSSL ~25% of the time.

Add a `_tls13_supported()` probe that tests whether the platform can
actually set TLS 1.3 as a minimum version, and only include that command
in the random pool when the probe passes. The probe runs once at import
time and caches the result in `_TLS13_OK`.

On OpenSSL (Linux, Homebrew Python, venvs): TLS 1.3 command is included
as before — full anti-fingerprinting surface preserved.

On LibreSSL (macOS system Python): TLS 1.3 command is excluded — no
crashes, still 3 randomization options (no-op, TLS 1.2 max, disable
tickets).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant