You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/04/06 13:56:32 UTC

[camel] branch main updated: CAMEL-17615: Ensure Kafka SSL configuration is applied for SASL_SSL protocol

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

jamesnetherton 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 edab91cc17e CAMEL-17615: Ensure Kafka SSL configuration is applied for SASL_SSL protocol
edab91cc17e is described below

commit edab91cc17e571d010ca92eda4cebddaa339a82c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Apr 6 13:07:36 2022 +0100

    CAMEL-17615: Ensure Kafka SSL configuration is applied for SASL_SSL protocol
---
 .../java/org/apache/camel/component/kafka/KafkaConfiguration.java     | 4 ++--
 1 file changed, 2 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 37f394b564c..b421a8c3300 100644
--- 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
@@ -418,7 +418,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     private void applyProducerSslConfiguration(Properties props) {
         final String securityProtocol = getSecurityProtocol();
 
-        if (securityProtocol.equals(SecurityProtocol.SSL.name())) {
+        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());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, getSslKeystoreLocation());
@@ -499,7 +499,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     private void applySslConsumerConfigurationFromOptions(Properties props) {
         final String securityProtocol = getSecurityProtocol();
 
-        if (securityProtocol.equals(SecurityProtocol.SSL.name())) {
+        if (securityProtocol.equals(SecurityProtocol.SSL.name()) || securityProtocol.equals(SecurityProtocol.SASL_SSL.name())) {
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, getSslKeyPassword());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, getSslKeystoreLocation());
             addPropertyIfNotEmpty(props, SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, getSslKeystorePassword());