← Back to Pull requests

SOLR-18659: Secure embedded ZooKeeper automatically when SSL is on #5329

Open
unknown opened this pull request with 382 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 12, 2026 21:41 UTC
Author

https://issues.apache.org/jira/browse/SOLR-18659

Summary


  • When Solr runs with HTTPS enabled and starts its own embedded ZooKeeper (no -z/--zk-host), the embedded ZooKeeper's client port now accepts TLS only. Solr configures this in Java at startup, in memory: the clientPort becomes a Netty secureClientPort using Solr's HTTPS keystore, truststore, and SSL credential providers. zoo.cfg and the include file are not rewritten, and no password files are created. This is a behavior change on upgrade for any such deployment, with both bin/solr and bin/solr.cmd.

  • The node running the embedded ZooKeeper connects to it over TLS automatically. Joining nodes and bin/solr CLI commands must add -Dzookeeper.client.secure=true (to SOLR_OPTS and SOLR_TOOL_OPTS respectively); Solr then derives the zookeeper.ssl. client settings from the javax.net.ssl. ones.

  • External ZooKeeper ensembles are unaffected: Solr can't know whether an independently administered ensemble uses TLS, so it assumes nothing.

  • ZookeeperStatusHandler (the Admin UI's ZooKeeper status page, SOLR-14027) now uses a TLS socket for its four-letter-word commands when zookeeper.client.secure is set. Two known limitations are left as TODOs: its cached SSL context isn't rebuilt when a keystore or truststore is replaced, and hostnames the JDK rejects for SNI (such as zoo_1) fail the request.

  • A node that starts the embedded ZooKeeper now skips NodeConfig's startup ZooKeeper connection check, since that ZooKeeper isn't running yet. This makes -DzkHost, including a chroot, usable with the embedded ZooKeeper; previously that startup always timed out.

  • SecurityAwareZkACLProvider now handles the root namespace (no chroot), with a new unit test.

  • Security policy: adds the grants Netty needs during the TLS handshake (JFR event registration, network-interface lookup) and the certificate-revocation property, in both the server and test policies.

  • The bin/solr start -e secure example and the securing-Solr tutorial (from #5306) rely on the automatic TLS instead of configuring it by hand, and use a /solr ZooKeeper chroot.
  • Originally tracked under SOLR-18527 (now closed/merged for the base secure example); this follow-on work is tracked under SOLR-18659.

    Test plan


  • test_secure_example.bats passes: the Admin UI ZooKeeper status endpoint against the TLS-only embedded ZooKeeper, the /solr chroot, ACL checks, and a plain bin/solr start -c with HTTPS and no -z

  • Unit tests, also under the security manager: SolrZkServerTest, SSLConfigurationsTest, ZookeeperSSLContextSupplierTest, NodeConfigZookeeperTlsTest, ZookeeperStatusHandlerSocketTest, SecurityAwareZkACLProviderTest

  • Manual walkthrough of the updated tutorial against a built distribution (last done before the chroot and -DzkHost changes)

  • Windows: bin/solr.cmd with HTTPS and embedded ZooKeeper (untested)
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_018RwsEje8u9apx3SRzissZm

    Diff: 382 lines (+286 / -96) across 4 files Reviewer: nick-boss-tech Review duration: 27109m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 382 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #5329"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.0% (MEDIUM) · Higher = larger blast radius
    43.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.9% · Safe to merge
    22.9%
    Repository