You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "uuuyuqi (via GitHub)" <gi...@apache.org> on 2026/07/09 02:59:16 UTC

[PR] Fix PU plaintext detection when AuthPolicy.NONE is configured [dubbo]

uuuyuqi opened a new pull request, #16374:
URL: https://github.com/apache/dubbo/pull/16374

   ## What is the purpose of the change?
   
   GitHub_issue: #16373
   
   This pull request fixes port-unification protocol detection when provider TLS is configured with `AuthPolicy.NONE`.
   
   `AuthPolicy.NONE` means 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 current `3.3` branch enters the TLS-detection branch, sees that the packet is not TLS, and then does nothing when the auth policy is `NONE`. 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:
   
   - TLS first packet: enable SSL and return.
   - Non-TLS first packet with required TLS: log, discard data, close the channel, and return.
   - Non-TLS first packet with `AuthPolicy.NONE`: fall through to plaintext `detectProtocol(...)`.
   
   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:
   
   - Before the production fix, the new regression test failed because the detector count was `0` instead of `1`.
   - `mvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am -Dtest=NettyPortUnificationServerHandlerTest,PortUnificationServerTest,SslServerTlsHandlerTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -DskipIntegrationTests=true -Djacoco.skip=true test`
   - `mvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am -DskipTests -DskipIntegrationTests=true -Djacoco.skip=true -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false verify`
   - `mvn -q -pl dubbo-remoting/dubbo-remoting-netty4 -am spotless:check`
   
   ## Checklist
   
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before the description, using `GitHub_issue: #123456`).
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exists. If the new feature or significant change is added, please remember to add integration-test in [dubbo-samples](https://github.com/apache/dubbo-samples) project.
   - [x] Make sure gitHub actions can pass, only after CI passed will we review it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix PU plaintext detection when AuthPolicy.NONE is configured [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16374:
URL: https://github.com/apache/dubbo/pull/16374#issuecomment-4921282410

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16374?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `11 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 29.81%. Comparing base ([`316df8e`](https://app.codecov.io/gh/apache/dubbo/commit/316df8e57677cc8c1ed6d92bd40ca0daba27393f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a4ffa53`](https://app.codecov.io/gh/apache/dubbo/commit/a4ffa53324961e06f212a95e614da924180cee6b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on 3.3.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/16374?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...port/netty4/NettyPortUnificationServerHandler.java](https://app.codecov.io/gh/apache/dubbo/pull/16374?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-netty4%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Ftransport%2Fnetty4%2FNettyPortUnificationServerHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5UG9ydFVuaWZpY2F0aW9uU2VydmVySGFuZGxlci5qYXZh) | 0.00% | [11 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16374?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (316df8e) and HEAD (a4ffa53). Click for more details.
   > 
   > <details><summary>HEAD has 8 uploads less than BASE</summary>
   >
   >| Flag | BASE (316df8e) | HEAD (a4ffa53) |
   >|------|------|------|
   >|samples-tests-java21|1|0|
   >|integration-tests-java21|1|0|
   >|integration-tests-java8|1|0|
   >|unit-tests-java25|1|0|
   >|unit-tests-java8|1|0|
   >|unit-tests-java11|1|0|
   >|unit-tests-java17|1|0|
   >|unit-tests-java21|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##                3.3   #16374       +/-   ##
   =============================================
   - Coverage     60.87%   29.81%   -31.06%     
   + Complexity    11767     9426     -2341     
   =============================================
     Files          1953     1952        -1     
     Lines         89260    89240       -20     
     Branches      13471    13387       -84     
   =============================================
   - Hits          54334    26605    -27729     
   - Misses        29342    58501    +29159     
   + Partials       5584     4134     -1450     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.81% <0.00%> (+0.07%)` | :arrow_up: |
   | [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16374/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo/pull/16374?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix PU plaintext detection when AuthPolicy.NONE is configured [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw merged PR #16374:
URL: https://github.com/apache/dubbo/pull/16374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org