You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/09/03 16:10:00 UTC
[jira] [Updated] (CAMEL-18304) Kafka SSLContextParameters support to resolve classpath Keystore and Truststore
[ https://issues.apache.org/jira/browse/CAMEL-18304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-18304:
--------------------------------
Fix Version/s: 3.x
> 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
> Fix For: 3.x
>
>
> 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.
> Camel Version- 3.14.3
> 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.
> We should invoke below method to load Keystore from class path and to use property place holders for passing password.
> https://github.com/apache/camel/blob/main/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java#L159
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)