Skip to content

Commonize TLS groups configuration between TLS, DTLS and QUIC - #68004

Draft
pimterry wants to merge 2 commits into
nodejs:mainfrom
pimterry:commonize-groups
Draft

pimterry wants to merge 2 commits into
nodejs:mainfrom
pimterry:commonize-groups

Conversation

@pimterry

@pimterry pimterry commented Dec 3, 2026

Copy link
Copy Markdown
Member

This is an alternative to #67991. Instead of adding one group to QUIC to patch the problem, this changes both QUIC & DTLS to directly use tls.DEFAULT_ECDH_CURVE and share their group configuration code.

That gives them matching defaults, but also means that global changes either via env var or CLI (#67993) apply to them too automatically, and stops them diverging in future.

This introduces new files for cross-module TLS negotiation code. Right now these are very small, so this looks a bit silly. These are minimal for now just focus on the groups question, but would expand later to commonize the other negotiation params too (ciphers, sigalgs, cert compression, etc). #67992 implementation could also live in here, or move later.

Opening as a draft with the same ngtcp2 floating patch cherry-picked from #67991.

pimterry and others added 2 commits December 4, 2026 00:19
Signed-off-by: Tim Perry <pimterry@gmail.com>
ngtcp2 discarded a 0-RTT packet that arrived after the first Initial
packet but before the 0-RTT key was installed. That happens when the
ClientHello spans several Initial packets, or when the handshake is
interrupted, as the QUIC server does to emit the new session. Buffer
the packet until the Handshake key is installed instead.

Assisted-by: Claude Opus 5.5
@pimterry
pimterry requested review from jasnell and panva December 3, 2026 23:33
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/gyp
  • @nodejs/net
  • @nodejs/quic
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Dec 3, 2026
// The option's value, or the process-wide default when it is omitted. OpenSSL
// accepts an empty list, leaving no groups and so no key exchange; only
// node:tls, for compatibility, passes allowEmpty.
function resolveGroups(groups, name, allowEmpty = false) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Plan here is a later breaking change to stop node:tls accepting '' as a valid value at all, so they're all consistent, but not today)

@jasnell

jasnell commented Dec 4, 2026

Copy link
Copy Markdown
Member

This generally lgtm but can we pull the dtls changes out into a separate pr? I have a stack of pending changes I'm about to open that will directly conflict. I want to include the dtls change here but will stack it on the other edits.

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

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants