fix: SslHandler retrieval for HTTP/1.1 client certificate auth - #22509
Open
jasstionzyf wants to merge 1 commit into
Open
fix: SslHandler retrieval for HTTP/1.1 client certificate auth#22509jasstionzyf wants to merge 1 commit into
jasstionzyf wants to merge 1 commit into
Conversation
…earch-project#22504) The SslHandler retrieval in ReactorNetty4BaseHttpChannel.get() prioritizes the parent channel's pipeline over the current channel's. For HTTP/1.1, the connection channel has a parent server channel, but its SslHandler is on the current channel — causing the parent lookup to return null and breaking client certificate authentication. Fix: check the current channel's pipeline first, and fall back to the parent only when no SslHandler is found on the current channel. Signed-off-by: jasstionzyf <jasstionzyf@gmail.com>
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Contributor
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22509 +/- ##
============================================
+ Coverage 73.43% 73.55% +0.11%
- Complexity 76472 76538 +66
============================================
Files 6104 6104
Lines 346573 346587 +14
Branches 49886 49888 +2
============================================
+ Hits 254514 254916 +402
+ Misses 71798 71441 -357
+ Partials 20261 20230 -31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
This is duplicate of #22506 |
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.
Summary
Fixes #22504 — SslHandler retrieval in
ReactorNetty4BaseHttpChannel.get()prioritizes the parent channel over the current channel, breaking client certificate authentication on HTTP/1.1.Root cause
For HTTP/1.1 connections, the connection channel has a parent server channel, but its
SslHandleris on the current channel. The original code checkedparent()first, which returned null — so the Security plugin could not retrieve theSSLEngineor peer certificate.HTTP/2 stream channels correctly inherit the TLS handler from the parent, so HTTP/2 was not affected.
Fix
Check the current channel first, and fall back to the parent only when no
SslHandleris found:Verified matrix (by reporter)
Issues resolved
Closes #22504
Signed-off-by: jasstionzyf jasstionzyf@gmail.com