@@ -25,8 +25,10 @@ public final class KafkaConfiguration {
2525 private String saslMechanism ;
2626 private String securityProtocol ;
2727 private String truststoreFile ;
28+ private String truststorePassword ;
2829 private String propertiesFile ;
2930 private String keystoreFile ;
31+ private String keystorePassword ;
3032
3133 public void applyCommon (Properties properties ) {
3234 properties .setProperty (CommonClientConfigs .BOOTSTRAP_SERVERS_CONFIG , brokerConnect );
@@ -39,12 +41,18 @@ public void applyCommon(Properties properties) {
3941 if (new File (truststoreFile ).isFile ()) {
4042 LOG .info ("Assigning truststore location to {}" , truststoreFile );
4143 properties .put ("ssl.truststore.location" , truststoreFile );
44+ if (truststorePassword != null && !truststorePassword .isEmpty ()) {
45+ properties .put ("ssl.truststore.password" , truststorePassword );
46+ }
4247 }
4348
4449 LOG .info ("Checking keystore file {}" , keystoreFile );
4550 if (new File (keystoreFile ).isFile ()) {
4651 LOG .info ("Assigning keystore location to {}" , keystoreFile );
4752 properties .put ("ssl.keystore.location" , keystoreFile );
53+ if (keystorePassword != null && !keystorePassword .isEmpty ()) {
54+ properties .put ("ssl.keystore.password" , keystorePassword );
55+ }
4856 }
4957
5058 LOG .info ("Checking properties file {}" , propertiesFile );
0 commit comments