Skip to content

https: encode all TLS fields in agent names - #67641

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ShogunPanda:https-agent-getname-tls-fields
Nov 22, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ShogunPanda:https-agent-getname-tls-fields

Conversation

@ShogunPanda

Copy link
Copy Markdown
Contributor

https.Agent#getName() joined several TLS options with : without encoding them, so a value containing : could shift into the next field and produce the same name as a different set of options. A DataView passed as dhparam was also reduced to its type name.

Encode the remaining string, boolean, number and buffer valued options with getTlsOptionKey(), which prefixes the type and the length, like the options that were already encoded.

Testing: extended test/parallel/test-https-agent-getname.js and updated test-https-agent-additional-options.js. The parallel/test-https-* and parallel/test-tls-* suites and eslint pass.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added https Issues and PRs related to the https subsystem. needs-ci PRs that need a full CI run. labels Nov 20, 2026
`https.Agent#getName()` joined several TLS options with `:` without
encoding them, so a value containing `:` could shift into the next field
and produce the same name as a different set of options. A `DataView`
passed as `dhparam` was also reduced to its type name.

Encode the remaining string, boolean, number, buffer and array valued
options, including `sigalgs`, with `getTlsOptionKey()`, which prefixes
the type and the length, like the options that were already encoded.

Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@ShogunPanda
ShogunPanda force-pushed the https-agent-getname-tls-fields branch from 579e2b7 to dde5f87 Compare November 20, 2026 09:02
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.73%. Comparing base (50ba1ec) to head (dde5f87).
⚠️ Report is 87 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67641      +/-   ##
==========================================
+ Coverage   90.71%   90.73%   +0.01%     
==========================================
  Files         801      801              
  Lines      280906   280905       -1     
  Branches    54246    54249       +3     
==========================================
+ Hits       254834   254879      +45     
+ Misses      16251    16205      -46     
  Partials     9821     9821              
Files with missing lines Coverage Δ
lib/https.js 97.26% <100.00%> (-0.01%) ⬇️

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

@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

@mcollina mcollina 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 20, 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 20, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

@jasnell jasnell added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 22, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 97d5d90 into nodejs:main Nov 22, 2026
68 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 97d5d90

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 22, 2026
aduh95 pushed a commit that referenced this pull request Nov 23, 2026
`https.Agent#getName()` joined several TLS options with `:` without
encoding them, so a value containing `:` could shift into the next field
and produce the same name as a different set of options. A `DataView`
passed as `dhparam` was also reduced to its type name.

Encode the remaining string, boolean, number, buffer and array valued
options, including `sigalgs`, with `getTlsOptionKey()`, which prefixes
the type and the length, like the options that were already encoded.

Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
PR-URL: #67641
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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. https Issues and PRs related to the https subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants