Skip to content

dtls: version 1.3 support - #67837

Open
jasnell wants to merge 9 commits into
nodejs:mainfrom
jasnell:dtls-1.3
Open

jasnell wants to merge 9 commits into
nodejs:mainfrom
jasnell:dtls-1.3

Conversation

@jasnell

@jasnell jasnell commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Update dtls to support version 1.3

A DTLS 1.3 PSK handshake has no peer certificate and looks like a
resumption, as with TLS 1.3, but only TLS1_3_VERSION was checked.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
Add minVersion and maxVersion. DTLS 1.2 stays the default.

DTLSv1_listen() cannot negotiate DTLS 1.3, so when it is enabled the
server validates addresses with a pending handshake per peer and only
announces the session once the cookie verifies.

Add session.onsessionticket, since DTLS 1.3 tickets arrive after the
handshake.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
TLS_ names in `ciphers` configure the DTLS 1.3 suites, as in node:tls.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
A server holding a certificate commits to a SHA-384 suite in its
HelloRetryRequest, which a client's SHA-256 PSK cannot be used with.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
Pin both versions explicitly in every test that completes a handshake,
so coverage does not depend on the default.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
Under DTLS 1.3 the server's psk callback runs for the first ClientHello,
before a session exists. An exception it threw was dropped; it now
reaches endpoint.onerror, which is documented.

Assisted-by: Claude Opus 5.5
Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell
jasnell requested a review from mcollina November 27, 2026 23:14
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. dependencies PRs that add, update, or configure Node.js dependencies. dtls Issues and PRs related to Datagram Transport Layer Security (DTLS). needs-ci PRs that need a full CI run. labels Nov 27, 2026
@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.54%. Comparing base (7ed1ca0) to head (f9c1c93).
⚠️ Report is 50 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67837      +/-   ##
==========================================
+ Coverage   90.51%   90.54%   +0.03%     
==========================================
  Files         805      805              
  Lines      285878   285796      -82     
  Branches    55200    55147      -53     
==========================================
+ Hits       258756   258772      +16     
+ Misses      17214    17151      -63     
+ Partials     9908     9873      -35     
Files with missing lines Coverage Δ
lib/internal/dtls/dtls.js 100.00% <100.00%> (ø)
lib/internal/dtls/symbols.js 100.00% <100.00%> (ø)

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Assisted-by: Claude Opus 5.5

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mertcanaltin mertcanaltin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@jasnell jasnell added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. experimental Issues and PRs related to experimental features. labels Nov 28, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 28, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 29, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 29, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. dependencies PRs that add, update, or configure Node.js dependencies. dtls Issues and PRs related to Datagram Transport Layer Security (DTLS). experimental Issues and PRs related to experimental features. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants