Skip to content

http2: destroy TLS sockets after fatal errors - #67215

Open
inoway46 wants to merge 2 commits into
nodejs:mainfrom
inoway46:fix/http2-tls-fatal-cleanup
Open

inoway46 wants to merge 2 commits into
nodejs:mainfrom
inoway46:fix/http2-tls-fatal-cleanup

Conversation

@inoway46

@inoway46 inoway46 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Destroy the TLS socket after a fatal TLS error so pending writes cannot block HTTP/2 session cleanup.

This reproduces on v26.13.0 but not on main, apparently due to the OpenSSL 4.1.0 upgrade in #66971. HTTP/2 should still ensure session cleanup completes when its TLS transport becomes unusable. This change is intended to make that behavior explicit and provide a candidate for backporting to v26 without a major OpenSSL upgrade.

Fixes: #67213

Cancel pending TLS writes after a fatal error so HTTP/2 session cleanup
can complete. Add coverage for TLS 1.3 client certificate rejection.

Fixes: nodejs#67213
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Codex
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels Nov 3, 2026
@inoway46
inoway46 marked this pull request as ready for review November 3, 2026 07:03
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (70074c6) to head (2b18300).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67215   +/-   ##
=======================================
  Coverage   90.71%   90.71%           
=======================================
  Files         797      797           
  Lines      278898   278902    +4     
  Branches    53627    53628    +1     
=======================================
+ Hits       252995   253006   +11     
+ Misses      16269    16264    -5     
+ Partials     9634     9632    -2     
Files with missing lines Coverage Δ
lib/internal/http2/core.js 94.93% <100.00%> (+<0.01%) ⬆️

... and 26 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.

Allow both OpenSSL and BoringSSL names for the same TLS alert in the
HTTP/2 fatal TLS error test. Keep the cleanup assertions unchanged.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Codex
@inoway46

inoway46 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Verified with v26.13.0 source builds: the patch resolves the session/socket leak, and the tested GOAWAY scenarios still pass. The regression test passed 20 consecutive runs.
Validation run

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

Labels

http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http2: client session leaks (no 'error', no 'close', socket never destroyed) when the server rejects the TLS handshake

2 participants