Skip to content

[3.15] Clarify TLS 1.3 behavior of the SSLContext PSK callbacks (GH-160159) - #160422

Merged
gpshead merged 1 commit into
python:3.15from
miss-islington:backport-9b9657c-3.15
Oct 23, 2026
Merged

gpshead merged 1 commit into
python:3.15from
miss-islington:backport-9b9657c-3.15

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

Under TLS 1.3 a PSK is only offered and may be declined, and both sides
fall back to certificate authentication when one is available, so
CERT_NONE leaves the server unauthenticated and a zero length PSK does
not reject the connection. Drop CERT_NONE from the example and the PSK
tests.

A callback that raises is treated like one returning a zero length PSK,
so under TLS 1.3 it also falls back to certificate authentication. A
server with a certificate loaded declines even a matching PSK with
OpenSSL's default TLS 1.3 cipher suite order, which selects a SHA-384
suite. Mention checking session_reused as the client side alternative
to not using CERT_NONE.
(cherry picked from commit 9b9657c)

Co-authored-by: Gregory P. Smith [email protected]

…0159)

Under TLS 1.3 a PSK is only offered and may be declined, and both sides
fall back to certificate authentication when one is available, so
CERT_NONE leaves the server unauthenticated and a zero length PSK does
not reject the connection.  Drop CERT_NONE from the example and the PSK
tests.

A callback that raises is treated like one returning a zero length PSK,
so under TLS 1.3 it also falls back to certificate authentication.  A
server with a certificate loaded declines even a matching PSK with
OpenSSL's default TLS 1.3 cipher suite order, which selects a SHA-384
suite.  Mention checking session_reused as the client side alternative
to not using CERT_NONE.
(cherry picked from commit 9b9657cf54060926721abff72b2aa28b7701d3c6)

Co-authored-by: Gregory P. Smith <[email protected]>
@read-the-docs-community

Copy link
Copy Markdown

@gpshead
gpshead merged commit fdf88ed into python:3.15 Oct 23, 2026
66 checks passed
@miss-islington
miss-islington deleted the backport-9b9657c-3.15 branch October 23, 2026 16:45
@github-project-automation github-project-automation Bot moved this from Todo to Done in Sprint Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants