GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [improve][misc] PIP-478: remove the superseded PIP-337 TLS stack (Personal CI) by lhotari · Pull Request #254 · lhotari/pulsar

Conversation

@lhotari

@lhotari lhotari commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Personal CI run — not for merge. Base is pulsar-pip478-stack-02-auth-plugins, a snapshot of the Athenz/SASL branch (#253), so the diff shows only this part.

PIP: apache#25890

Re-derivation of #247, which no longer applied — the base moved far enough that it conflicted six ways. Rather than force a merge, the removal was rebuilt from current reachability, using the original as a statement of intent. +23 / −3239 across 25 files.

Three commits

  1. The PIP-337 factory stack — PulsarSslFactory, DefaultPulsarSslFactory, PulsarSslConfiguration, KeyManagerProxy, TrustManagerProxy, KeyStoreSSLContext, SSLContextValidatorEngine and the four tests that exist only to exercise them. Each verified unreachable, including by class-name string: the config keys that once named the default factory are gone and now sit on the removed-key tolerance lists, which two existing tests already pin.
  2. SecurityUtility — one live consumer was left, message crypto's BouncyCastle lookup. It moves to JcaProviders.requireBouncyCastleProvider(), same FIPS-agnostic resolution, same first-use timing. Conscrypt registration survives; both classes register it in their static initializers.
  3. The CN-matching machinery — TlsHostnameVerifier and friends, whose only referent was SecurityUtility.

Two deliberate departures from the original

The SAN-only claim is corrected, not carried. The original announced that hostname verification becomes SAN-only and a CN-only certificate is no longer accepted. That is false on the default engines: per RFC 6125 the CN is consulted when a certificate carries no dNSName SAN, and Netty's native engine delegates hostname checking to the Java trust manager, so the JDK's CN fallback governs there too. Verified with real handshakes against this repo's own fixtures. The real change is narrower — SecurityUtility's static initializer installed a CN-tolerant process-global verifier for Conscrypt, so Conscrypt-pinned clients are what tighten. Four documents asserting the wrong claim are corrected, plus eleven test comments and two certificate scripts that repeated it.

The ClusterData removal is dropped. It removed brokerClientSslFactoryPlugin / ...Params on the rationale that "factory selection is broker-level" — which the core migration refuted, since per-cluster selection is real. pip-478.md argues their retention as a compatibility decision in nine places, one promising a 5.0 broker "preserves it rather than erasing it on rewrite". Removing them would also delete the only operator-facing stale-value signal and erase the fields from stored metadata on any rewrite, silently downgrading a 4.x broker in a mixed fleet.

Verifying this change

sanityCheck (all modules, main + test), quickCheck, and :pulsar-common:test --tests '*tls*' --tests '*Crypto*' pass locally. Reviewed by Codex (no findings) and Fable, whose review caught the missed fourth SAN/CN passage — the breaking-change bullet the corrected passages route readers to.

Prepared with the assistance of Claude Code (Opus 5).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the PIP label Aug 12, 2026
lhotari added 4 commits August 13, 2026 03:19
@lhotari
[improve][misc] PIP-478: remove the superseded PIP-337 PulsarSslFacto…
542d404
…ry stack

The PIP-337 TLS infrastructure has no callers left. The core migration replaced it with
the PulsarTlsFactory SPI and the common.util.tls helpers, and the configuration keys that
once named DefaultPulsarSslFactory by class name (sslFactoryPlugin,
brokerClientSslFactoryPlugin) are gone — they now sit on the removed-key tolerance lists,
which PulsarConfigurationLoaderTest and ConfigurationDataUtilsTest already pin.

Deleted, each verified unreachable from any production path: PulsarSslFactory,
DefaultPulsarSslFactory, PulsarSslConfiguration, KeyManagerProxy, TrustManagerProxy,
KeyStoreSSLContext, SSLContextValidatorEngine, and the four tests that exist only to
exercise them. SSLContextValidatorEngine had no references at all, not even from its
sibling.

SecurityUtility.createAutoRefreshSslContextForClient goes with them: it was the sole
production referent of KeyManagerProxy and TrustManagerProxy and had no callers of its
own. The rest of SecurityUtility is removed in the next commit, once its last live
consumer is migrated.

Despite its name and package, SslContextTest is not a general Netty test — every case
constructs a DefaultPulsarSslFactory with a PulsarSslConfiguration.

Assisted-by: Claude Code (Opus 5)
@lhotari
[improve][misc] PIP-478: resolve BouncyCastle via JcaProviders and re…
1ec7470
…move SecurityUtility

SecurityUtility had exactly one live consumer left after the PIP-337 stack went: message
crypto's BouncyCastle provider lookup. Point it at the decomposed equivalent and delete the
monolith.

MessageCryptoBc now resolves the provider through
JcaProviders.requireBouncyCastleProvider(), which performs the same FIPS-agnostic lookup —
non-FIPS "BC" or FIPS "BCFIPS", whichever is on the classpath. The lookup stays inside the
initialization-on-demand holder, so a resolution failure still surfaces at first
asymmetric-crypto use rather than at class loading. One deliberate difference: an absent
BouncyCastle now fails with an IllegalStateException naming the caller instead of a
RuntimeException wrapping the classpath-load failure. Same failure point, better message.

Conscrypt registration is unaffected. Both classes register it eagerly in their static
initializers, so it still lands in the JCA provider list; what SecurityUtility additionally
installed — a process-global CN-tolerant hostname verifier — is dealt with in the next
commit, where the classes it depended on are removed.

Assisted-by: Claude Code (Opus 5)
@lhotari
[improve][misc] PIP-478: remove the deprecated CN-based hostname matc…
286be1f
…hing

Pulsar carried its own hostname verifier — TlsHostnameVerifier plus SubjectName,
PublicSuffixMatcher, PublicSuffixList and DomainType — whose only referent was
SecurityUtility, now gone. Delete them; verification is whatever the configured provider
implements under the standard endpoint-identification algorithm "HTTPS".

Be precise about the compatibility story, because the obvious statement of it is wrong.
The standard algorithm is NOT SAN-only. Per RFC 6125 the JDK and OpenSSL/BoringSSL engines
consult a certificate's CN when it carries no dNSName SAN, and ignore the CN once any is
present — verified here with real JDK handshakes against this repo's own fixtures: the
CN-only hn-verification/broker-cert.pem is accepted for its CN host and rejected for
another, and the SAN-bearing broker.cert.pem is rejected for its CN host. So on the default
engines a CN-only certificate is accepted exactly as before.

What does change is Conscrypt-pinned clients. SecurityUtility's static initializer
installed the CN-tolerant verifier as Conscrypt's process-global default; without it,
Conscrypt applies its own RFC 2818 verification and rejects a server certificate with no
subjectAltName. That reaches a deployment only if it names Conscrypt as its client-side
JSSE provider and still uses CN-only server certificates. Conscrypt is never the
client-side default — it is defaulted only for TlsPurpose.WEB, i.e. server listeners, which
do not verify hostnames.

Four documents asserted the SAN-only guarantee and are corrected rather than kept:
pip-478.md's summary line, its hostname-matching bullet, its breaking-change note, and the
common.tls package javadoc. Deliberately no new "CN-only must be rejected" test: it would
fail today on the default engines, which is the point.

Both in-repo SAN-less server certificates are negative fixtures on the default engine and
keep passing for the same reason as before — AuthenticationTlsHostnameVerificationTest
fails on CN mismatch, not on SAN absence.

Assisted-by: Claude Code (Opus 5)
@lhotari
[improve][misc] PIP-478: finish correcting the hostname-verification …
fa40bd0
…record

Review found that three of the four CN/SAN passages were corrected and the fourth was not —
and the one missed is the breaking-change bullet under Backward & Forward Compatibility,
which is exactly where the other two send compatibility readers. It still announced "SAN
required" and "a CN-only certificate no longer suffices", contradicting the Security
Considerations text two sections above. An operator following the document's own routing
would have reissued fleet certificates for a break that does not exist on the default
engines.

The bullet now states what actually changes: hostname verification is on by default, a
matching SAN always suffices, the CN is still consulted on the default engines for a
certificate carrying no dNSName SAN, and Conscrypt-pinned clients are what tighten.

The mechanism is stated precisely too. Netty's native OpenSSL/BoringSSL engine does not
verify the hostname itself — it delegates to the Java trust manager — so the JDK's
HostnameChecker and its CN fallback govern both default engines, not BoringSSL's own
matching.

Also swept the framing out of the code: the broker TLS support javadoc claimed PIP-478
turns on "SAN-only verification", and eleven proxy tests plus two certificate-generation
scripts carried the same phrase, so the corrected record would have been contradicted by
the next file a reader opened.

Two mislabels found in the same review, pre-existing but adjacent: the trust-manager
fallback is documented as being for "a provider that offers none (e.g. Conscrypt)", but
real Conscrypt registers both PKIX factories — the fallback is for a third-party provider,
and the test stub named "Conscrypt-shaped" models a provider that does not exist. Renamed
and re-described. The same javadoc still advertised a Conscrypt hostname-verifier
propagation workaround whose body was removed when Conscrypt 2.6.1 landed.

Assisted-by: Claude Code (Opus 5)
@lhotari
lhotari force-pushed the lh-pip-478-remove-pip337-v3 branch from 6994374 to fa40bd0 Compare August 13, 2026 00:19
@lhotari lhotari changed the title [improve][common] PIP-478: remove the superseded PIP-337 TLS stack (Personal CI) [improve][misc] PIP-478: remove the superseded PIP-337 TLS stack (Personal CI) Aug 13, 2026
This was referenced Aug 13, 2026
[improve][misc] PIP-478: follow-ups and PIP reconciliation (Personal CI) #255
Closed
[improve][misc] PIP-478: remove the superseded PIP-337 TLS stack (not merged to master) apache/pulsar#26320
Merged
[improve][misc] PIP-478: remove the superseded PIP-337 TLS stack apache/pulsar#26322
Merged
@lhotari lhotari closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

PIP

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@lhotari
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.