fix: apply sslTrustStoreLocation to Kafka Connect / Schema Registry REST clients regardless of authMethod#761
Merged
fhussonnois merged 1 commit intostreamthoughts:mainfrom Apr 16, 2026
Conversation
The Kafka Connect and Schema Registry REST clients only wired the SSL config (truststore, keystore, hostname verification) into the underlying HTTP client when authMethod was SSL (mTLS). For basicAuth and none, the sslTrustStoreLocation property was loaded but never applied, so HTTPS calls to a server using a private CA always failed with PKIX path building failed. Also makes RestClientBuilder.sslConfig() null-safe so it can be called with a sparsely populated SSLConfig (e.g. truststore only, no keystore; or no password) without throwing NullPointerException on toCharArray() or trying to open a null keystore path. Adds: - Unit tests in RestClientBuilderTest covering the empty / hostname-only / truststore-only paths. - An HTTPS integration test in SchemaRegistryApiFactoryTest that serves a self-signed cert and verifies the configured truststore is honored for basicAuth. Without the fix it fails with PKIX path building failed. Fixes streamthoughts#757. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fhussonnois
approved these changes
Apr 16, 2026
Member
fhussonnois
left a comment
There was a problem hiding this comment.
LGTM! Thank you for this new contribution :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Kafka Connect and Schema Registry REST client factories only wired the configured
SSLConfig(truststore, keystore, hostname verification) into the underlying HTTP client whenauthMethod = SSL(mTLS). ForauthMethod = basicAuthornone, thesslTrustStoreLocationproperty was loaded into the config object (visible injikkou config view) but never applied to the SSL context. Any HTTPS call to a server backed by a private/internal CA failed with:The only workaround today is to set
JAVA_TOOL_OPTIONS=-Djavax.net.ssl.trustStore=...at the JVM level, which bypasses Jikkou's own config.Changes
KafkaConnectApiFactory.create()andSchemaRegistryApiFactory.createForUrl()now callbuilder.sslConfig(config.sslConfig().get())before theAuthMethodswitch, so the truststore (and keystore, and hostname-verification override) is honored for every auth method, not justSSL.RestClientBuilder.sslConfig()is now null-safe — it no longer NPEs on a sparsely populatedSSLConfig:keyStoreLocationisnull(key managers staynull, whichSSLContext.initalready accepts).nulltrustStorePassword/keyStorePasswordasnullchar[]instead of NPEing on.toCharArray().SSLUtils.createTrustManagers()already handles anulltrustStoreLocationby falling back to the JVM's defaultcacerts.ignoreHostnameVerification).RestClientBuilderTest— three new cases exercising the empty / hostname-only / truststore-only paths against a plain HTTPMockWebServer, all of which previously NPEd.SchemaRegistryApiFactoryTest— new integration test that starts an HTTPSMockWebServerwith a self-signed cert (viaokhttp-tls'sHeldCertificate+HandshakeCertificates), writes the cert into a JKS truststore in@TempDir, and verifies thatlistSubjects()succeeds withAuthMethod.BASICAUTH+ that truststore. Without this PR's fix, the same test fails with the exact PKIX error from the issue.The Schema Registry test covers the fix structurally — the Kafka Connect factory takes the identical change. No HTTPS test was added in
jikkou-provider-kafka-connectto keep this PR independent of the open #760 (which is what introducesmockwebserverto that pom).Test plan
mvn test -pl extension-rest-client— 16 tests pass (3 new SSL cases + 13 existing)mvn test -pl providers/jikkou-provider-schema-registry— 59 tests pass (1 new HTTPS case + 58 existing)mvn test -pl providers/jikkou-provider-kafka-connect— 37 tests pass (no regressions)SchemaRegistryApiFactorychange makesshouldApplyTrustStoreForBasicAuthOverHttpsfail with the issue's exact error message — confirms the test catches the bug.Fixes #757.
🤖 Generated with Claude Code