Skip to content

Preserve configured client hostname verification with Netty 4.2 - #2474

Closed
xiangfu0 wants to merge 1 commit into
apache:masterfrom
xiangfu0:xiangfu0/codex2/zookeeper-netty42-hostname-policy
Closed

xiangfu0 wants to merge 1 commit into
apache:masterfrom
xiangfu0:xiangfu0/codex2/zookeeper-netty42-hostname-policy

Conversation

@xiangfu0

Copy link
Copy Markdown

Netty 4.2 defaults client builders to HTTPS endpoint identification. ZooKeeper’s existing trust-manager/engine policy honors zookeeper.ssl.hostnameVerification, but the new builder default rejects a trusted mismatched SAN even when that setting is false.

Clear only the client builder’s endpoint-identification default, leaving the existing configured ZooKeeper verifier and server mutual-TLS policy in control. Extend the existing DNS/IP × FIPS mismatch cases to test both enabled and disabled hostname verification. The call also compiles with the current Netty 4.1.138 pin; this PR does not upgrade Netty.

How to reproduce

Run SSLHostnameVerificationTest#testClientHostnameVerificationWithMismatchNames with runtime Netty 4.2.19. Before the production fix, all four hostnameVerification=false cases fail; the four enabled-policy cases retain rejection. With the fix, all eight pass.

Using a Maven wrapper against this checkout after compiling/installing its source at the normal pin:

/path/to/mvnw -f pom.xml -pl zookeeper-server -Dnetty.version=4.2.19.Final \
  -Dsurefire-forkcount=1 \
  -Dtest=SSLHostnameVerificationTest#testClientHostnameVerificationWithMismatchNames \
  dependency:properties surefire:test

Repeat with -Dzookeeper.ssl.sslProvider=OPENSSL for the native provider.

Validation

  • JDK 25: patched real client/server mismatch matrix passes 8/8 with JDK TLS and 8/8 with Netty tcnative BoringSSL/OpenSSL. Unmodified production-source controls fail exactly the four disabled-policy cases for each provider. Session and hostname-verification exception logs corroborate the outcomes.
  • All 12 existing ClientSSLTest positive provider/FIPS/policy cases pass at runtime Netty 4.2.19, including matching-name verification and create/delete operations on three server sessions.
  • Restored patch compiles at the normal Netty 4.1.138 pin; Checkstyle reports zero violations and the diff check passes.
  • Broader selected ClientSSLTest runs retain existing negative-assertion failures at parameter cases [2]/[4], also reproduced on unmodified production source (that control additionally failed [6]). No expectation was changed or test disabled; full upstream CI has not been certified.

This is a master fix. The released 3.9.6 client used by apache/pinot#19828 remains affected; a release-line fix and published artifact are separate prerequisites before that consumer can claim compatibility.

Reproduction: a trusted server with a mismatched SAN cannot connect under Netty 4.2 even when zookeeper.ssl.hostnameVerification=false. Clear the builder default so the existing ZooKeeper configured verifier continues to own the policy. Extend the existing DNS/IP and FIPS mismatch matrix to cover disabled verification.
@xiangfu0
xiangfu0 force-pushed the xiangfu0/codex2/zookeeper-netty42-hostname-policy branch from 7c90259 to a7b5fb4 Compare October 14, 2026 00:04
@xiangfu0 xiangfu0 closed this Oct 14, 2026
@xiangfu0
xiangfu0 deleted the xiangfu0/codex2/zookeeper-netty42-hostname-policy branch October 14, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant