You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/03 17:11:46 UTC

[camel] branch main updated: CAMEL-19691: camel-kafka - Allow sslKeystorePassword to be blank. (#10973)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 30b4288d8fd CAMEL-19691: camel-kafka - Allow sslKeystorePassword to be blank. (#10973)
30b4288d8fd is described below

commit 30b4288d8fdb53085bc67a7e28b2b586d7eecbfc
Author: Vaishnavi R <66...@users.noreply.github.com>
AuthorDate: Thu Aug 3 22:41:40 2023 +0530

    CAMEL-19691: camel-kafka - Allow sslKeystorePassword to be blank. (#10973)
    
    CAMEL-19691: camel-kafka - Allow sslKeystorePassword to be blank.
    
    CAMEL-19691: camel-kafka - Allow sslKeystorePassword to be blank.
---
 .../java/org/apache/camel/component/kafka/KafkaConfiguration.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
index f1c2b9feac2..ee876733493 100755
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
@@ -430,7 +430,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     private void applyProducerSslConfiguration(Properties props) {
         if (securityProtocol.equals(SecurityProtocol.SSL.name()) || securityProtocol.equals(SecurityProtocol.SASL_SSL.name())) {
             addPropertyIfNotEmpty(props, CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, getSecurityProtocol());
-            addPropertyIfNotEmpty(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, getSslKeyPassword());
+            addPropertyIfNotNull(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, getSslKeyPassword());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, getSslKeystoreLocation());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, getSslKeystorePassword());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, getSslTruststoreLocation());
@@ -511,7 +511,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
 
     private void applySslConsumerConfigurationFromOptions(Properties props) {
         if (securityProtocol.equals(SecurityProtocol.SSL.name()) || securityProtocol.equals(SecurityProtocol.SASL_SSL.name())) {
-            addPropertyIfNotEmpty(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, getSslKeyPassword());
+            addPropertyIfNotNull(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, getSslKeyPassword());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, getSslKeystoreLocation());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, getSslKeystorePassword());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, getSslTruststoreLocation());
@@ -1906,4 +1906,4 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     public void setKerberosConfigLocation(String kerberosConfigLocation) {
         this.kerberosConfigLocation = kerberosConfigLocation;
     }
-}
+}
\ No newline at end of file