Repository navigation
fix: do not send a request on a connection verified for another servername - #6233
Merged
Merged
Conversation
…rname Since #6219, a request aborted while it waits for a connection leaves the queue. When a Client serves several TLS server names and the aborted request was the last one for the name it was connecting for, _resume() switched client[kServerName] to the next queued request's name while the connection was pending. Once connected, that connection, whose certificate was verified for the previous name, was used for the next request. A connection attempt now records the servername it verifies. If the Client switched to another name by the time it connects, the socket is destroyed and a new connection is opened for the current name. When _resume() switches the name, it also cancels the pending attempt, so the request does not wait for a connection it cannot use. A certificate name error now only fails the requests for the name it was raised for. Refs: #6219 Signed-off-by: Matteo Collina <hello@matteocollina.com>
ronag
approved these changes
Nov 20, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6233 +/- ##
=======================================
Coverage 91.71% 91.72%
=======================================
Files 113 113
Lines 44813 44835 +22
=======================================
+ Hits 41102 41124 +22
Misses 3711 3711 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
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.
Since #6219, a request aborted while it waits for a connection leaves the queue. When a Client serves several TLS server names, as with
interceptors.dns()or a per-requestservername, and the aborted request was the last one for the name being connected,_resume()switched to the next request's servername while the connection was still pending. Once connected, that connection, whose certificate was verified for the previous name, was used for the next request. This is a regression in 8.13.0.A connection attempt now records the servername it verifies and is discarded if the Client switched to another name by the time it connects. When
_resume()switches names, it also cancels the pending attempt, so the next request does not wait for a connection it cannot use. A certificate name error now fails only the requests for the name it was raised for.test/servername-switch-while-connecting.jscovers h1, h2, an Agent with the dns interceptor, and a custom connector that cannot be cancelled.Reported privately by @w116tjb.