Skip to content

P08: Port runtime TLS defaults to ZooKeeper 3.8.7 - #184

Merged
bellatrix007 merged 2 commits into
adbansal/zk-387-p07-secure-client-addressesfrom
adbansal/zk-387-p08-tls-defaults
Dec 3, 2026
Merged

bellatrix007 merged 2 commits into
adbansal/zk-387-p07-secure-client-addressesfrom
adbansal/zk-387-p08-tls-defaults

Conversation

@bellatrix007

@bellatrix007 bellatrix007 commented Nov 23, 2026 •

Copy link
Copy Markdown

Description

Port #143 (ZOOKEEPER-4415 / ZOOKEEPER-4912) to 3.8.7, stacked on #183. Select TLSv1.3 when the runtime supports it, otherwise TLSv1.2. When protocol/cipher overrides are absent, use the selected context's default enabled protocols and stop imposing ZooKeeper's hardcoded cipher list.

JDK sockets use JDK cipher defaults; Netty server engines use Netty defaults. Explicit configured socket/server-engine overrides and the target FIPS, hostname-verification, password-file and SSLContext-supplier paths are retained.

The existing Netty client behavior is unchanged: its raw SSLContext engine does not apply ssl.enabledProtocols or ssl.ciphersuites. This PR does not add an unrelated client override-enforcement fix.

Tests

  • Extended X509UtilTest with actual socket/engine defaults, explicit and invalid overrides, and certificate-verified negotiation with default and TLSv1.2-only peers. Pinned the existing renegotiation test to TLSv1.2.

  • Java 11: 374 focused cases plus 181 supplemental baseline/TLS cases passed. Java 8 and 17 each ran a 414-case selected baseline/TLS suite.

  • Three initial hostname-based client failures were transport errors before TLS. After native hostname routing recovered, the unchanged eight-case SSL client selection passed on each JDK (24 rerun executions). Negative hostname-verification controls still rejected certificate names. Original failed runs are retained, not reported as clean first runs.

  • Java 11 assembly, RAT, Checkstyle including tests and SpotBugs passed.

  • All installed JDKs support TLSv1.3; fallback on an older runtime without it is not runtime-qualified. These are selected local suites, not full production or mixed-version rollout qualification.

  • The additional Netty TLSv1.3 cipher assertion and rebase passed 44 selected Java 11 cases; the strengthened method also passed all 8 parameterized rows on each of Java 8 and 17. RAT, Checkstyle including tests, and SpotBugs passed on Java 11.

  • Local code review completed

Changes that Break Backward Compatibility (Optional)

  • Unset properties can now negotiate TLSv1.3 and use different cipher suites/order. Effective defaults depend on the JDK and TLS implementation rather than the previous fixed ZooKeeper list.
  • X509Util.DEFAULT_PROTOCOL is computed at class initialization, not a compile-time constant. Old binaries can retain the inlined TLSv1.2 value until recompiled; source usages requiring a constant expression need adjustment.
  • The obsolete package-private getDefaultCipherSuites() and getDefaultCipherSuitesForJavaVersion() helpers are removed. Upgrading a server does not upgrade separately deployed application client JARs.

Documentation (Optional)

Updated the TLS property entries in zookeeperAdmin.md with runtime capability selection, JDK/Netty default distinctions, override scope and client/constant compatibility caveats.

🤖 Generated with GitHub Copilot CLI


Tests generated with unit-tests plugin

@arkmish arkmish left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch inherits P07's (#183) stale pre-e2eb23564a base, causing mvn (full-build-java-tests, 11) to fail on ReadOnlyModeTest.testConnectionEvents (failed job). Please rebase once #183 is rebased onto current #182 HEAD.

Aditi Bansal and others added 2 commits December 2, 2026 10:14
Select TLSv1.3 when supported, retain explicit socket and server-engine options, and keep the target FIPS and SSLContext APIs. Add runtime defaults, override, and negotiation regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain the default-delegation comparison and independently require an
enabled TLS 1.3 cipher suite when TLS 1.3 is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p08-tls-defaults branch from fefcfa5 to 0af0cfd Compare December 2, 2026 05:00
@bellatrix007 bellatrix007 added the upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x label Dec 2, 2026

@arkmish arkmish left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for addressing the comments.

@bellatrix007
bellatrix007 merged commit 1622010 into li-dev/base-3.8.7 Dec 3, 2026
24 checks passed
@bellatrix007
bellatrix007 deleted the adbansal/zk-387-p08-tls-defaults branch December 3, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants