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

acosentino pushed a commit to branch 23182
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8981c9c2ceb8c5eebd9394cb4f65700e29734dba
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Mar 12 10:51:01 2026 +0100

    CAMEL-23182 - Post-Quantum Cryptography (PQC) readiness: camel-mongodb: Add 
SSLContextParameters support and fix hardcoded TLS version
    
    Signed-off-by: Andrea Cosentino <[email protected]>
---
 .../apache/camel/catalog/components/mongodb.json   | 10 ++-
 .../dsl/MongodbComponentBuilderFactory.java        | 18 ++++
 .../dsl/MongoDbEndpointBuilderFactory.java         | 96 ++++++++++++++++++++++
 3 files changed, 120 insertions(+), 4 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb.json
index f43887c6e313..c746dd4bc09c 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb.json
@@ -27,7 +27,8 @@
     "mongoConnection": { "index": 0, "kind": "property", "displayName": "Mongo 
Connection", "group": "common", "label": "", "required": false, "type": 
"object", "javaType": "com.mongodb.client.MongoClient", "deprecated": false, 
"autowired": true, "secret": false, "description": "Shared client used for 
connection. All endpoints generated from the component will share this 
connection client." },
     "bridgeErrorHandler": { "index": 1, "kind": "property", "displayName": 
"Bridge Error Handler", "group": "consumer", "label": "consumer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Allows for bridging the consumer to the Camel routing Error Handler, which 
mean any exceptions (if possible) occurred while the Camel consumer is trying 
to pickup incoming messages, or the like [...]
     "lazyStartProducer": { "index": 2, "kind": "property", "displayName": 
"Lazy Start Producer", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Whether the producer should be started lazy (on the first message). By 
starting lazy you can use this to allow CamelContext and routes to startup in 
situations where a producer may otherwise fail [...]
-    "autowiredEnabled": { "index": 3, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching t [...]
+    "autowiredEnabled": { "index": 3, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching t [...]
+    "useGlobalSslContextParameters": { "index": 4, "kind": "property", 
"displayName": "Use Global Ssl Context Parameters", "group": "security", 
"label": "security", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Enable usage of global SSL context 
parameters." }
   },
   "headers": {
     "CamelMongoDbOperation": { "index": 0, "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"org.apache.camel.component.mongodb.MongoDbOperation or String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The operation this endpoint will execute against MongoDB.", 
"constantName": 
"org.apache.camel.component.mongodb.MongoDbConstants#OPERATION_HEADER" },
@@ -111,8 +112,9 @@
     "streamFilter": { "index": 50, "kind": "parameter", "displayName": "Stream 
Filter", "group": "changeStream", "label": "consumer,changeStream", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "Filter condition for 
change streams consumer." },
     "authSource": { "index": 51, "kind": "parameter", "displayName": "Auth 
Source", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "description": "The database name associated with the 
user's credentials." },
     "password": { "index": 52, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "description": "User password for mongodb connection" },
-    "tls": { "index": 53, "kind": "parameter", "displayName": "Tls", "group": 
"security", "label": "security", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": false, "description": "Specifies that all communication 
with MongoDB instances should use TLS. Supersedes the ssl option. Default: 
false" },
-    "tlsAllowInvalidHostnames": { "index": 54, "kind": "parameter", 
"displayName": "Tls Allow Invalid Hostnames", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "Specifies that the driver should allow invalid hostnames 
in the certificate for TLS connections. Supersedes sslInvalidHostNameAllowed. 
Has the same effect as tlsInsecure by setti [...]
-    "username": { "index": 55, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "description": "Username for mongodb connection" }
+    "sslContextParameters": { "index": 53, "kind": "parameter", "displayName": 
"Ssl Context Parameters", "group": "security", "label": "security", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, 
"autowired": false, "secret": false, "description": "SSL configuration using a 
Camel SSLContextParameters object. When configured, TLS is automatically 
enabled on the connection." },
+    "tls": { "index": 54, "kind": "parameter", "displayName": "Tls", "group": 
"security", "label": "security", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": false, "description": "Specifies that all communication 
with MongoDB instances should use TLS. Supersedes the ssl option. Default: 
false" },
+    "tlsAllowInvalidHostnames": { "index": 55, "kind": "parameter", 
"displayName": "Tls Allow Invalid Hostnames", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "Specifies that the driver should allow invalid hostnames 
in the certificate for TLS connections. Supersedes sslInvalidHostNameAllowed. 
Has the same effect as tlsInsecure by setti [...]
+    "username": { "index": 56, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "description": "Username for mongodb connection" }
   }
 }
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java
index 8b97868dfc7c..a5c22d59daca 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java
@@ -141,6 +141,23 @@ public interface MongodbComponentBuilderFactory {
             doSetProperty("autowiredEnabled", autowiredEnabled);
             return this;
         }
+    
+        
+        /**
+         * Enable usage of global SSL context parameters.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: security
+         * 
+         * @param useGlobalSslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongodbComponentBuilder useGlobalSslContextParameters(boolean 
useGlobalSslContextParameters) {
+            doSetProperty("useGlobalSslContextParameters", 
useGlobalSslContextParameters);
+            return this;
+        }
     }
 
     class MongodbComponentBuilderImpl
@@ -160,6 +177,7 @@ public interface MongodbComponentBuilderFactory {
             case "bridgeErrorHandler": ((MongoDbComponent) 
component).setBridgeErrorHandler((boolean) value); return true;
             case "lazyStartProducer": ((MongoDbComponent) 
component).setLazyStartProducer((boolean) value); return true;
             case "autowiredEnabled": ((MongoDbComponent) 
component).setAutowiredEnabled((boolean) value); return true;
+            case "useGlobalSslContextParameters": ((MongoDbComponent) 
component).setUseGlobalSslContextParameters((boolean) value); return true;
             default: return false;
             }
         }
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java
index 39028de92732..9d99a543eae5 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java
@@ -461,6 +461,38 @@ public interface MongoDbEndpointBuilderFactory {
             doSetProperty("password", password);
             return this;
         }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointConsumerBuilder 
sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointConsumerBuilder sslContextParameters(String 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
         /**
          * Specifies that all communication with MongoDB instances should use
          * TLS. Supersedes the ssl option. Default: false.
@@ -1777,6 +1809,38 @@ public interface MongoDbEndpointBuilderFactory {
             doSetProperty("password", password);
             return this;
         }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointProducerBuilder 
sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointProducerBuilder sslContextParameters(String 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
         /**
          * Specifies that all communication with MongoDB instances should use
          * TLS. Supersedes the ssl option. Default: false.
@@ -3022,6 +3086,38 @@ public interface MongoDbEndpointBuilderFactory {
             doSetProperty("password", password);
             return this;
         }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointBuilder 
sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
+        /**
+         * SSL configuration using a Camel SSLContextParameters object. When
+         * configured, TLS is automatically enabled on the connection.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.support.jsse.SSLContextParameters</code> 
type.
+         * 
+         * Group: security
+         * 
+         * @param sslContextParameters the value to set
+         * @return the dsl builder
+         */
+        default MongoDbEndpointBuilder sslContextParameters(String 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
         /**
          * Specifies that all communication with MongoDB instances should use
          * TLS. Supersedes the ssl option. Default: false.

Reply via email to