@@ -29,8 +29,10 @@ public final class KafkaConfiguration {
2929 private String saslMechanism ;
3030 private String securityProtocol ;
3131 private String truststoreFile ;
32+ private String truststorePassword ;
3233 private String propertiesFile ;
3334 private String keystoreFile ;
35+ private String keystorePassword ;
3436
3537 public void applyCommon (Properties properties ) {
3638 properties .setProperty (CommonClientConfigs .BOOTSTRAP_SERVERS_CONFIG , brokerConnect );
@@ -43,12 +45,18 @@ public void applyCommon(Properties properties) {
4345 if (new File (truststoreFile ).isFile ()) {
4446 LOG .info ("Assigning truststore location to {}" , truststoreFile );
4547 properties .put ("ssl.truststore.location" , truststoreFile );
48+ if (truststorePassword != null && !truststorePassword .isEmpty ()) {
49+ properties .put ("ssl.truststore.password" , truststorePassword );
50+ }
4651 }
4752
4853 LOG .info ("Checking keystore file {}" , keystoreFile );
4954 if (new File (keystoreFile ).isFile ()) {
5055 LOG .info ("Assigning keystore location to {}" , keystoreFile );
5156 properties .put ("ssl.keystore.location" , keystoreFile );
57+ if (keystorePassword != null && !keystorePassword .isEmpty ()) {
58+ properties .put ("ssl.keystore.password" , keystorePassword );
59+ }
5260 }
5361
5462 LOG .info ("Checking properties file {}" , propertiesFile );
0 commit comments