From 7fc39374a4bffb04ae4da6aff7794a1bb47b31ad Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Wed, 2 Sep 2026 09:21:07 +0200 Subject: [PATCH] Fix #2791: expose sslContextParameters on the opensearch Kamelets The issue suggested mapping the component's SSL parameters onto Kamelet properties. camel-opensearch has no such parameters: its entire TLS surface beyond enableSSL and certificatePath is one option, sslContextParameters, typed org.apache.camel.support.jsse.SSLContextParameters. There is nothing scalar for cipher suites, protocol version, keystores or hostname verification to map to. So this takes the issue's second suggestion and lets the operator point at a pre-configured bean, which reaches all of those at once. Building the SSLContextParameters inside the template from scalar properties -- the pattern aws-redshift-sink uses for its data source -- does not work here. Kamelet beans are created unconditionally, and sslContextParameters takes precedence over certificatePath, so an always-present bean would silently disable the existing certificate property for everyone. The property is optional and passed with {{?sslContextParameters}}, so when unset the parameter is omitted entirely and behaviour is unchanged. Verified against the real component: with sslContextParameters set to "#bean:mySsl" the endpoint resolves the registry bean and connects over https, failing only with connection refused as there is no cluster; a second route on the same run with the property unset starts unaffected. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013cgbAH6uDsSJDhMdunDzTS --- kamelets/opensearch-index-sink.kamelet.yaml | 10 ++++++++++ kamelets/opensearch-search-source.kamelet.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/kamelets/opensearch-index-sink.kamelet.yaml b/kamelets/opensearch-index-sink.kamelet.yaml index 17c264a90..4a78056fb 100644 --- a/kamelets/opensearch-index-sink.kamelet.yaml +++ b/kamelets/opensearch-index-sink.kamelet.yaml @@ -69,6 +69,15 @@ spec: description: The name of the OpenSearch index. type: string example: data + sslContextParameters: + title: SSL Context Parameters + description: >- + Reference to a registry bean of type org.apache.camel.support.jsse.SSLContextParameters, + written as "#bean:myBeanName". Use this for anything the certificate property cannot + express - mutual TLS with a client keystore, a custom trust store, a specific TLS protocol + version, or cipher suite selection. When set it takes precedence over certificate, so + configure one or the other rather than both. + type: string certificate: title: Certificate description: The Certificate for accessing the OpenSearch cluster. You must encode this value in base64. @@ -129,3 +138,4 @@ spec: enableSSL: "{{enableSSL}}" indexName: "{{?indexName}}" certificatePath: "base64:{{?certificate}}" + sslContextParameters: "{{?sslContextParameters}}" diff --git a/kamelets/opensearch-search-source.kamelet.yaml b/kamelets/opensearch-search-source.kamelet.yaml index 7249283d0..3786383cf 100644 --- a/kamelets/opensearch-search-source.kamelet.yaml +++ b/kamelets/opensearch-search-source.kamelet.yaml @@ -77,6 +77,15 @@ spec: title: OpenSearch Cluster Name description: The name of the cluster. type: string + sslContextParameters: + title: SSL Context Parameters + description: >- + Reference to a registry bean of type org.apache.camel.support.jsse.SSLContextParameters, + written as "#bean:myBeanName". Use this for anything the certificate property cannot + express - mutual TLS with a client keystore, a custom trust store, a specific TLS protocol + version, or cipher suite selection. When set it takes precedence over certificate, so + configure one or the other rather than both. + type: string certificate: title: Certificate description: The Certificate for accessing the Opensearch cluster. You must encode this value in base64. @@ -112,6 +121,7 @@ spec: hostAddresses: "{{hostAddresses}}" enableSSL: "{{enableSSL}}" certificatePath: "base64:{{?certificate}}" + sslContextParameters: "{{?sslContextParameters}}" - marshal: json: library: Gson