You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Aniket Jadhav (Jira)" <ji...@apache.org> on 2022/07/26 07:24:00 UTC

[jira] [Created] (CAMEL-18304) Kafka SSLContextParameters support to resolve classpath Keystore and Truststore

Aniket Jadhav created CAMEL-18304:
-------------------------------------

             Summary: Kafka SSLContextParameters support to resolve classpath Keystore and Truststore 
                 Key: CAMEL-18304
                 URL: https://issues.apache.org/jira/browse/CAMEL-18304
             Project: Camel
          Issue Type: New Feature
          Components: camel-kafka
            Reporter: Aniket Jadhav


Kafka component does have the provision to provide bean of org.apache.camel.support.jsse.SSLContextParameters as a sslContextParameters property.

But it does not support parsing the value for Keystore and TrustStore like path , password etc also not loads it from classpath like in HttpComponent.

Example - I have created bean of sslContextParameter and passing it to Kafka Component as below 
<camel:sslContextParameters id="sslContextParameters">
    <camel:keyManagers keyPassword="\{{keystore.key.password}}">
        <camel:keyStore resource="keystore/keystore.jks" password="\{{keystore.password}}"/>
    </camel:keyManagers>
    <camel:trustManagers>
        <camel:keyStore resource="truststore/truststore.jks" password="\{{truststore.password}}"/>
    </camel:trustManagers>
</camel:sslContextParameters>
 
 <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="ctx" streamCache="true" useMDCLogging="true" > 
        <propertyPlaceholder id="placeholder" location="classpath:config_${ENV}.properties,classpath:config.properties" ignoreMissingLocation="true" propertiesParserRef="jasypt"/>
 <endpoint id="kafkaConsumerEndpoint" uri="\{kafka.topic}}">
            <property key="brokers" value="\{{kafka.brokers}}"/>
            <property key="sslContextParameters" value="#sslContextParameters"/>
            <property key="groupId" value="xyz"/>
            <property key="securityProtocol" value="SSL"/>
            <property key="reconnectBackoffMs" value="120000"/>
            <property key="sslEndpointAlgorithm" value=""/>
            <property key="allowManualCommit" value="true"/>
            <property key="autoCommitEnable" value="false"/>
        </endpoint>
</camelContext>
As It does not support to load Keystore and Truststore from classpath and not parsing properties we can't use property placeholder and classpath resources.  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)