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:14:55 UTC

[camel] branch camel-3.20.x 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 camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


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

commit 104c6001d41ab87fd1a74e90754bf6dfca05f553
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    | 5 +++--
 1 file changed, 3 insertions(+), 2 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 c911123c375..e4b80793328 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
@@ -422,7 +422,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());
@@ -503,7 +503,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());
@@ -1878,3 +1878,4 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
         this.isolationLevel = isolationLevel;
     }
 }
+