Repository navigation
https: key agent on empty servername and ecdhCurve - #67935
Open
ShogunPanda wants to merge 1 commit into
Open
ShogunPanda wants to merge 1 commit into
ShogunPanda wants to merge 1 commit into
Conversation
Agent.prototype.getName() only appended servername and ecdhCurve when they were truthy, so an explicitly empty value produced the same agent name as an absent option. Sockets and TLS sessions are keyed by that name, so they were shared between the two configurations. Encode an empty string for these options with the existing TLS option key encoding. Names for absent options, other values and a servername equal to host are unchanged. Signed-off-by: Paolo Insogna <paolo@cowtech.it> Assisted-By: OpenAI:GPT-6-Sol <openai/gpt-6-sol>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67935 +/- ##
==========================================
- Coverage 92.96% 90.59% -2.37%
==========================================
Files 432 802 +370
Lines 201044 286657 +85613
Branches 30702 55367 +24665
==========================================
+ Hits 186900 259700 +72800
- Misses 13816 17071 +3255
- Partials 328 9886 +9558
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https.Agent.prototype.getName()only appendedservernameandecdhCurveto the agent name when they were truthy. An explicitly empty value (servername: ''orecdhCurve: '') therefore produced the same name as the option being absent, and since sockets and the TLS session cache are keyed by that name, they were shared between the two configurations.This change encodes an empty string for these two options with the existing TLS option key encoding, so they get distinct names. Names for absent options, other values, and a
servernameequal tohostare unchanged.An empty
ecdhCurveis not a valid curve: with this change such a request no longer silently reuses a socket created for the default configuration, and fails consistently when its TLS context is created instead.test/parallel/test-https-agent-getname.jsis extended with the new cases.Release notes
https.Agentno longer shares sockets and TLS sessions between requests that pass an explicitly emptyservernameorecdhCurveand requests that omit the option.