Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pem cert support to connect to kafka clusters #511

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,20 @@ public Properties getSslConfig(String clusterIdentification) {
Properties props = new Properties();

try {
if (!Strings.isNullOrEmpty(
env.getProperty(
clusterIdentification.toLowerCase() + ".kafkassl.keystore.certificate.chain"))) {
props.put(
SslConfigs.SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG,
env.getProperty(
clusterIdentification.toLowerCase() + ".kafkassl.keystore.certificate.chain"));
}
if (!Strings.isNullOrEmpty(
env.getProperty(clusterIdentification.toLowerCase() + ".kafkassl.keystore.key"))) {
props.put(
SslConfigs.SSL_KEYSTORE_KEY_CONFIG,
env.getProperty(clusterIdentification.toLowerCase() + ".kafkassl.keystore.key"));
}
if (!Strings.isNullOrEmpty(
env.getProperty(clusterIdentification.toLowerCase() + ".kafkassl.keystore.location"))) {
props.put(
Expand Down
3 changes: 2 additions & 1 deletion cluster-api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

# Uncomment the below SSL properties to connect to Kafka clusters over SSL.
# Each of the below block can be repeated for a cluster with unique cluster identification id
# JKS/PKCS12/PEM certificate types can be configured

#clusterid.kafkassl.keystore.location=client.keystore.p12
#clusterid.kafkassl.keystore.pwd=klaw1234
#clusterid.kafkassl.key.pwd=klaw1234
#clusterid.kafkassl.keystore.type=pkcs12
#clusterid.kafkassl.truststore.location=client.truststore.jks
#clusterid.kafkassl.truststore.pwd=klaw1234
#clusterid.kafkassl.keystore.type=pkcs12
#clusterid.kafkassl.truststore.type=JKS

# Uncomment the below SASL properties to connect to Kafka clusters over SASL
Expand Down