Skip to content

ssl: expose the negotiated TLS-1.3 group in connection_information - #11440

Open
jbevemyr wants to merge 1 commit into
erlang:masterfrom
jbevemyr:expose-selected-group
Open

ssl: expose the negotiated TLS-1.3 group in connection_information#11440
jbevemyr wants to merge 1 commit into
erlang:masterfrom
jbevemyr:expose-selected-group

Conversation

@jbevemyr

@jbevemyr jbevemyr commented Aug 9, 2026

Copy link
Copy Markdown

The named group of the TLS-1.3 key exchange is negotiated via the supported_groups and key_share extensions and is already kept in the connection state (session.ecc), but connection_information/1,2 never exposed it: the existing ecc item only covers pre-TLS-1.3 named-curve cipher suites.

With the arrival of post-quantum hybrid groups (x25519mlkem768 and friends, OTP 28) the negotiated group has become operationally interesting: an application or an operator auditing a fleet wants to know whether a given connection actually negotiated a quantum-safe key exchange or fell back to a classical group. Today that is only visible through packet inspection or debug-level handshake logging (and for hybrid groups, openssl s_client prints a "Negotiated TLS1.3 group" line for the same reason).

This adds a selected_group item, returned for TLS-1.3 connections on both the client and the server side:

{ok, [{selected_group, x25519mlkem768}]} =
    ssl:connection_information(Socket, [selected_group]).

The item is absent for pre-TLS-1.3 connections (where ecc retains its existing semantics), and absent when no group was negotiated. Functionally verified against both a hybrid-first and a classical-only peer; ssl_api_SUITE:connection_information extended to assert the item on both sides for TLS-1.3 and its absence otherwise.

@CLAassistant

CLAassistant commented Aug 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

Tests are running... https://github.com/erlang/otp/actions/runs/31312512455

Results for commit cfbfe56

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

  • No CT logs found
  • No HTML docs found
  • No Windows Installer found

// Erlang/OTP Github Action Bot

@jbevemyr
jbevemyr force-pushed the expose-selected-group branch from cfbfe56 to efe83e1 Compare August 9, 2026 19:33
The named group of the TLS-1.3 key exchange is negotiated via the
supported_groups and key_share extensions and is already kept in the
connection state (session.ecc), but connection_information/1,2 never
exposed it: the existing ecc item only covers pre-TLS-1.3 named-curve
cipher suites.

With the arrival of post-quantum hybrid groups (X25519MLKEM768 and
friends) the negotiated group has become operationally interesting:
an application or an operator auditing a fleet wants to know whether a
given connection actually negotiated a quantum-safe key exchange or
fell back to a classical group. Today that is only visible by packet
inspection or debug-level handshake logging.

Add a selected_group item, returned for TLS-1.3 connections on both
the client and the server side.
@jbevemyr
jbevemyr force-pushed the expose-selected-group branch from efe83e1 to 6a19d6a Compare August 9, 2026 19:35
@jbevemyr

jbevemyr commented Aug 9, 2026

Copy link
Copy Markdown
Author

Verification done on this branch, built from source on x86_64 Linux:

  • ssl_api_SUITE -case connection_information passes (1 ok, 0 failed) — the case now asserts selected_group membership in ssl:groups() for TLS-1.3 and its absence otherwise.
  • Both behavior branches checked directly against the built runtime: a TLS-1.3 connection reports {selected_group, ...} on both the client and the server side (also present in the connection_information/1 full list), a TLS-1.2 connection reports nothing and the pre-existing ecc item semantics are untouched.
  • Also verified with post-quantum hybrid groups on OTP 28 (x25519mlkem768 negotiated and reported), which is the motivating use case.
  • ./otp_build check --no-tests --no-docs --no-format-check: dialyzer passes, license-header scan 0 warnings in 11963 files. (--no-format-check because the patch has no C changes; the license check's git-history comparison step needs a full clone, the scan itself is clean.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants