diff --git a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/utils/ClusterApiUtils.java b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/utils/ClusterApiUtils.java index a0cd124607..d002d72d32 100644 --- a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/utils/ClusterApiUtils.java +++ b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/utils/ClusterApiUtils.java @@ -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( diff --git a/cluster-api/src/main/resources/application.properties b/cluster-api/src/main/resources/application.properties index 984604d3cf..1e8846e9a6 100644 --- a/cluster-api/src/main/resources/application.properties +++ b/cluster-api/src/main/resources/application.properties @@ -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