[ 
https://issues.apache.org/jira/browse/CAMEL-18304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aniket Jadhav updated CAMEL-18304:
----------------------------------
    Description: 
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 
{code:java}
<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> {code}
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.  

  was:
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 
{code:java}
<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> {code}
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.  


> 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
>            Priority: Major
>              Labels: kafka, sslContextParameters
>
> 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 
> {code:java}
> <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> {code}
> 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)

Reply via email to