docs: OPENSSL_CONF workaround for TLS handshake on OpenSSL 3.5+#752
Merged
gijzelaerr merged 1 commit intoJun 19, 2026
Merged
Conversation
On OpenSSL >= 3.5 the default TLS 1.3 ClientHello advertises the X25519MLKEM768 post-quantum group, whose ~1.2 KB key share the S7-1500 rejects — it drops the handshake, so connect(use_tls=True) fails with a connection reset. The PLC mandates TLS 1.3 (TLS 1.2 is refused outright) and CPython's ssl exposes no API for the TLS 1.3 supported_groups list, so document restricting them to classic ECDHE curves via an OPENSSL_CONF file. Follow-up to gijzelaerr#746 (the in-code ctypes group restriction was declined). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gijzelaerr
reviewed
Jun 19, 2026
gijzelaerr
left a comment
Owner
There was a problem hiding this comment.
Review
Docs-only, accurate, and well-written.
Correctness: The X25519MLKEM768 post-quantum group issue on OpenSSL ≥ 3.5 is a real problem — the ~1.2 KB key share exceeds what the S7-1500 TLS stack accepts. The OPENSSL_CONF approach is the correct workaround given CPython's ssl has no supported_groups API for TLS 1.3. The Groups = x25519:secp256r1:secp384r1 selection is sensible — standard ECDHE curves, no security downgrade.
Security: No concerns. These are the same curves OpenSSL < 3.5 used by default. Removing only the PQ hybrid group.
Placement: Fits naturally under the existing S7CommPlus TLS section in doc/connecting.rst.
Ready to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document the
OPENSSL_CONFworkaround for TLS on OpenSSL 3.5+Follow-up to #746. That PR restricted the TLS 1.3 key-exchange groups in-code via
ctypes, which was (rightly) declined now that the ctypes dependency is gone. This documents the pure-configuration alternative instead.Background
On OpenSSL ≥ 3.5 (Debian 13, recent distros) the default TLS 1.3
ClientHelloadvertises the post-quantum hybrid groupX25519MLKEM768, whose ~1.2 KB key share the S7-1500 rejects — it resets the connection mid-handshake, soconnect(use_tls=True)fails.I confirmed against a live S7-1500 that:
sslexposes no API for the TLS 1.3supported_groupslist (set_ecdh_curveonly affects ≤ TLS 1.2).So the only dependency-free fix is to restrict the groups through OpenSSL's own config via
OPENSSL_CONF.What's here
A new subsection in
doc/connecting.rst(under S7CommPlus over TLS) with the ready-to-useOPENSSL_CONFfile, theGroups = x25519:secp256r1:secp384r1setting, and a note that it must be set in the environment before the process starts (OpenSSL reads it once at init). Docs-only change.