Fix PU plaintext detection when AuthPolicy.NONE is configured#16374
Merged
Conversation
Change-Id: Ic201a42623151d99369a2692b8e8206a2b281007
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16374 +/- ##
============================================
- Coverage 60.87% 60.86% -0.01%
+ Complexity 11767 11763 -4
============================================
Files 1953 1953
Lines 89260 89262 +2
Branches 13471 13471
============================================
- Hits 54334 54333 -1
+ Misses 29342 29337 -5
- Partials 5584 5592 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 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.
What is the purpose of the change?
GitHub_issue: #16373
Fixes #16373
This pull request fixes port-unification protocol detection when provider TLS is configured with
AuthPolicy.NONE.AuthPolicy.NONEmeans TLS is optional. If a client sends a non-TLS first packet to the port-unification port, the server should continue with plaintext protocol detection. The current3.3branch enters the TLS-detection branch, sees that the packet is not TLS, and then does nothing when the auth policy isNONE. As a result, plaintext Dubbo detection is skipped and the connection waits until the caller times out.The fix keeps the existing strict-TLS behavior unchanged:
AuthPolicy.NONE: fall through to plaintextdetectProtocol(...).This PR also adds a regression test that provides an optional-TLS test
CertProvider, sends a Dubbo plaintext first packet, and verifies that the plaintext protocol detector is invoked.Verification:
0instead of1.mvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am -Dtest=NettyPortUnificationServerHandlerTest,PortUnificationServerTest,SslServerTlsHandlerTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -DskipIntegrationTests=true -Djacoco.skip=true testmvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am -DskipTests -DskipIntegrationTests=true -Djacoco.skip=true -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false verifymvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am spotless:checkChecklist
GitHub_issue: #123456).