Skip to content

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

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

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

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]>
@gpshead
gpshead merged commit 2ae9141 into python:3.14 Oct 23, 2026
61 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Sprint Oct 23, 2026
@miss-islington
miss-islington deleted the backport-9b9657c-3.14 branch October 23, 2026 16:45
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