fix(tls): Load custom CA and client certificates for SSL connections - #4
Merged
Conversation
Fixes #3 The Kafka client was ignoring ssl_ca_location, ssl_certificate_location, and ssl_key_location configuration fields, causing "UnknownIssuer" errors when connecting to brokers with self-signed or internal CA certificates. Changes: - Add TLS configuration module (kafka/tls.rs) that properly loads: - Custom CA certificates from ssl_ca_location - Client certificates for mTLS from ssl_certificate_location - Client private keys from ssl_key_location - Falls back to webpki-roots when no custom CA is specified - Add TLS-specific error variants for clear error messages - Add unit tests for certificate loading - Add integration test infrastructure with Docker Compose - Update configuration documentation with TLS examples Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adding #[non_exhaustive] allows new error variants to be added in future minor releases without being a breaking change. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
Breaking Change AcknowledgmentThe semver-check CI is failing because this PR adds new error variants to the
This is technically a breaking change for code that exhaustively pattern-matches on However, this is intentional and acceptable because:
Recommendation: Merge this PR and bump the minor version (0.3.0 → 0.4.0) in the next release to indicate potential breaking changes. |
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
Fixes #3
The Kafka client was ignoring
ssl_ca_location,ssl_certificate_location, andssl_key_locationconfiguration fields, causing "UnknownIssuer" errors when connecting to brokers with self-signed or internal CA certificates.Changes
kafka/tls.rs) that properly loads:ssl_ca_locationssl_certificate_locationssl_key_locationFiles Changed
crates/kafka-backup-core/src/kafka/tls.rscrates/kafka-backup-core/src/kafka/client.rscrates/kafka-backup-core/src/error.rsdocs/configuration.mdtests/tls-test-infra/Test plan
cargo test -p kafka-backup-core tls(7 tests)cargo test -p kafka-backup-core(89 tests)To run integration tests manually:
🤖 Generated with Claude Code