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

davsclaus pushed a commit to branch CAMEL-27666-bonita-https
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 33eb2f397d3246672045130bcef8516a5c15d37f
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 27 16:32:11 2026 +0100

    CAMEL-27666: camel-bonita - Add HTTPS support
    
    BonitaAPIConfig.getBaseBonitaURI() always built an http:// URI, so the
    login, the session cookies and the X-Bonita-API-Token were sent in clear
    text and a Bonita server that only accepts HTTPS could not be reached.
    
    The new endpoint option protocol (http or https, default http) selects
    the protocol. The new endpoint option sslContextParameters and the
    component option useGlobalSslContextParameters set the SSL context of
    the JAX-RS clients of the producer: the client of the REST calls and
    file uploads, and the client of each login.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../apache/camel/catalog/components/bonita.json    |  11 +-
 .../camel/catalog/docs/bonita-component.adoc       |  19 ++
 .../bonita/BonitaComponentConfigurer.java          |   6 +
 .../component/bonita/BonitaEndpointConfigurer.java |   9 +
 .../component/bonita/BonitaEndpointUriFactory.java |   4 +-
 .../org/apache/camel/component/bonita/bonita.json  |  11 +-
 .../src/main/docs/bonita-component.adoc            |  19 ++
 .../camel/component/bonita/BonitaComponent.java    |  22 ++-
 .../component/bonita/BonitaConfiguration.java      |  28 +++
 .../component/bonita/api/BonitaAPIBuilder.java     |  12 +-
 .../bonita/api/filter/BonitaAuthFilter.java        |   4 +-
 .../component/bonita/api/util/BonitaAPIConfig.java |  59 +++++-
 .../component/bonita/api/util/BonitaAPIUtil.java   |   4 +-
 .../bonita/producer/BonitaStartProducer.java       |  12 +-
 .../camel/component/bonita/BonitaHttpsTest.java    | 210 +++++++++++++++++++++
 .../bonita/api/util/BonitaAPIConfigTest.java       |  25 +++
 .../src/test/resources/jsse/localhost.p12          | Bin 0 -> 2606 bytes
 .../dsl/BonitaComponentBuilderFactory.java         |  19 ++
 .../endpoint/dsl/BonitaEndpointBuilderFactory.java |  55 ++++++
 19 files changed, 504 insertions(+), 25 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
index b7d7e73c9f39..d968ea12bcec 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
@@ -25,7 +25,8 @@
   },
   "componentProperties": {
     "lazyStartProducer": { "index": 0, "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": 1, "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": 1, "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": 2, "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, for the endpoints with the https protocol that have no 
sslContextParameters of their own." }
   },
   "headers": {
     "CamelBonitaCaseId": { "index": 0, "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "The id of the case that the startCase operation started.", 
"constantName": "org.apache.camel.component.bonita.BonitaConstants#CASE_ID" }
@@ -39,8 +40,10 @@
     "hostname": { "index": 1, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the \/bonita con [...]
     "port": { "index": 2, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
     "processName": { "index": 3, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The name of the process to start a case of. 
The producer searches the processes of the Bonita REST API for this  [...]
-    "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "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 produc [...]
-    "password": { "index": 5, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
-    "username": { "index": 6, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "protocol": { "index": 4, "kind": "parameter", "displayName": "Protocol", 
"group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "java.lang.String", "enum": [ "http", "https" ], "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": "http", 
"configurationClass": "org.apache.camel.component.bonita.BonitaConfiguration", 
"configurationField": "configuration", "description": "The protocol of the REST 
API of the Bonita server: http, or https to [...]
+    "lazyStartProducer": { "index": 5, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "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 produc [...]
+    "password": { "index": 6, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "sslContextParameters": { "index": 7, "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, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The SSL configuration of the HTTPS connections 
to t [...]
+    "username": { "index": 8, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
   }
 }
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bonita-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bonita-component.adoc
index a00598677bfb..4ebf714f9af7 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bonita-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bonita-component.adoc
@@ -40,6 +40,25 @@ Any other body, also JSON text that is not an object (such 
as a JSON array), fai
 After the operation, the body is still the `Map` of the inputs, or the JSON 
text that was sent.
 The id of the started case is set in the `CamelBonitaCaseId` header.
 
+=== Using HTTPS
+
+By default, the producer calls the REST API of Bonita over plain HTTP, so the 
username and password of the login,
+the session cookies and the `X-Bonita-API-Token` header are sent in clear text.
+Set the `protocol` option to `https` to send them over TLS, and set `port` to 
the HTTPS port of the Bonita server.
+
+When the JVM does not trust the certificate of the Bonita server, configure a 
trust store with the
+`sslContextParameters` option (or with the global SSL context parameters of 
Camel and the
+`useGlobalSslContextParameters` option of the component). The SSL context is 
used for the login and for all the
+requests of the producer. Without it, the default SSL context of the JVM is 
used. It is ignored with the `http`
+protocol.
+
+[source,java]
+----
+from("direct:start")
+    
.to("bonita:startCase?protocol=https&hostname=bonita.example.com&port=8443&processName=TestProcess"
+        + 
"&username=install&password=install&sslContextParameters=#bonitaSsl");
+----
+
 
 == Examples
 
diff --git 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaComponentConfigurer.java
 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaComponentConfigurer.java
index 78f36378df48..bdbb555e7410 100644
--- 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaComponentConfigurer.java
+++ 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaComponentConfigurer.java
@@ -28,6 +28,8 @@ public class BonitaComponentConfigurer extends 
PropertyConfigurerSupport impleme
         case "autowiredEnabled": 
target.setAutowiredEnabled(property(camelContext, boolean.class, value)); 
return true;
         case "lazystartproducer":
         case "lazyStartProducer": 
target.setLazyStartProducer(property(camelContext, boolean.class, value)); 
return true;
+        case "useglobalsslcontextparameters":
+        case "useGlobalSslContextParameters": 
target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, 
value)); return true;
         default: return false;
         }
     }
@@ -39,6 +41,8 @@ public class BonitaComponentConfigurer extends 
PropertyConfigurerSupport impleme
         case "autowiredEnabled": return boolean.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
+        case "useglobalsslcontextparameters":
+        case "useGlobalSslContextParameters": return boolean.class;
         default: return null;
         }
     }
@@ -51,6 +55,8 @@ public class BonitaComponentConfigurer extends 
PropertyConfigurerSupport impleme
         case "autowiredEnabled": return target.isAutowiredEnabled();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
+        case "useglobalsslcontextparameters":
+        case "useGlobalSslContextParameters": return 
target.isUseGlobalSslContextParameters();
         default: return null;
         }
     }
diff --git 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
index 0c7568573e61..a1c686750c73 100644
--- 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
+++ 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
@@ -31,6 +31,9 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": target.getConfiguration().setPort(property(camelContext, 
java.lang.String.class, value)); return true;
         case "processname":
         case "processName": 
target.getConfiguration().setProcessName(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "protocol": 
target.getConfiguration().setProtocol(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "sslcontextparameters":
+        case "sslContextParameters": 
target.getConfiguration().setSslContextParameters(property(camelContext, 
org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
         case "username": 
target.getConfiguration().setUsername(property(camelContext, 
java.lang.String.class, value)); return true;
         default: return false;
         }
@@ -46,6 +49,9 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": return java.lang.String.class;
         case "processname":
         case "processName": return java.lang.String.class;
+        case "protocol": return java.lang.String.class;
+        case "sslcontextparameters":
+        case "sslContextParameters": return 
org.apache.camel.support.jsse.SSLContextParameters.class;
         case "username": return java.lang.String.class;
         default: return null;
         }
@@ -62,6 +68,9 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": return target.getConfiguration().getPort();
         case "processname":
         case "processName": return target.getConfiguration().getProcessName();
+        case "protocol": return target.getConfiguration().getProtocol();
+        case "sslcontextparameters":
+        case "sslContextParameters": return 
target.getConfiguration().getSslContextParameters();
         case "username": return target.getConfiguration().getUsername();
         default: return null;
         }
diff --git 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
index 78c3eaa20d61..75c021724dcd 100644
--- 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
+++ 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
@@ -24,13 +24,15 @@ public class BonitaEndpointUriFactory extends 
org.apache.camel.support.component
     private static final Set<String> ENDPOINT_IDENTITY_PROPERTY_NAMES;
     private static final Map<String, String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(7);
+        Set<String> props = new HashSet<>(9);
         props.add("hostname");
         props.add("lazyStartProducer");
         props.add("operation");
         props.add("password");
         props.add("port");
         props.add("processName");
+        props.add("protocol");
+        props.add("sslContextParameters");
         props.add("username");
         PROPERTY_NAMES = Collections.unmodifiableSet(props);
         Set<String> secretProps = new HashSet<>(2);
diff --git 
a/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
 
b/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
index b7d7e73c9f39..d968ea12bcec 100644
--- 
a/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
+++ 
b/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
@@ -25,7 +25,8 @@
   },
   "componentProperties": {
     "lazyStartProducer": { "index": 0, "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": 1, "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": 1, "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": 2, "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, for the endpoints with the https protocol that have no 
sslContextParameters of their own." }
   },
   "headers": {
     "CamelBonitaCaseId": { "index": 0, "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "The id of the case that the startCase operation started.", 
"constantName": "org.apache.camel.component.bonita.BonitaConstants#CASE_ID" }
@@ -39,8 +40,10 @@
     "hostname": { "index": 1, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the \/bonita con [...]
     "port": { "index": 2, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
     "processName": { "index": 3, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The name of the process to start a case of. 
The producer searches the processes of the Bonita REST API for this  [...]
-    "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "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 produc [...]
-    "password": { "index": 5, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
-    "username": { "index": 6, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "protocol": { "index": 4, "kind": "parameter", "displayName": "Protocol", 
"group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "java.lang.String", "enum": [ "http", "https" ], "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": "http", 
"configurationClass": "org.apache.camel.component.bonita.BonitaConfiguration", 
"configurationField": "configuration", "description": "The protocol of the REST 
API of the Bonita server: http, or https to [...]
+    "lazyStartProducer": { "index": 5, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "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 produc [...]
+    "password": { "index": 6, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "sslContextParameters": { "index": 7, "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, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The SSL configuration of the HTTPS connections 
to t [...]
+    "username": { "index": 8, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
   }
 }
diff --git a/components/camel-bonita/src/main/docs/bonita-component.adoc 
b/components/camel-bonita/src/main/docs/bonita-component.adoc
index a00598677bfb..4ebf714f9af7 100644
--- a/components/camel-bonita/src/main/docs/bonita-component.adoc
+++ b/components/camel-bonita/src/main/docs/bonita-component.adoc
@@ -40,6 +40,25 @@ Any other body, also JSON text that is not an object (such 
as a JSON array), fai
 After the operation, the body is still the `Map` of the inputs, or the JSON 
text that was sent.
 The id of the started case is set in the `CamelBonitaCaseId` header.
 
+=== Using HTTPS
+
+By default, the producer calls the REST API of Bonita over plain HTTP, so the 
username and password of the login,
+the session cookies and the `X-Bonita-API-Token` header are sent in clear text.
+Set the `protocol` option to `https` to send them over TLS, and set `port` to 
the HTTPS port of the Bonita server.
+
+When the JVM does not trust the certificate of the Bonita server, configure a 
trust store with the
+`sslContextParameters` option (or with the global SSL context parameters of 
Camel and the
+`useGlobalSslContextParameters` option of the component). The SSL context is 
used for the login and for all the
+requests of the producer. Without it, the default SSL context of the JVM is 
used. It is ignored with the `http`
+protocol.
+
+[source,java]
+----
+from("direct:start")
+    
.to("bonita:startCase?protocol=https&hostname=bonita.example.com&port=8443&processName=TestProcess"
+        + 
"&username=install&password=install&sslContextParameters=#bonitaSsl");
+----
+
 
 == Examples
 
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaComponent.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaComponent.java
index 1f042f8ad707..60db4ad64c18 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaComponent.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaComponent.java
@@ -20,12 +20,19 @@ import java.util.Map;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
+import org.apache.camel.SSLContextParametersAware;
 import org.apache.camel.component.bonita.util.BonitaOperation;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 
 @Component("bonita")
-public class BonitaComponent extends DefaultComponent {
+public class BonitaComponent extends DefaultComponent implements 
SSLContextParametersAware {
+
+    @Metadata(label = "security", defaultValue = "false",
+              description = "Enable usage of global SSL context parameters, 
for the endpoints with the https protocol that"
+                            + " have no sslContextParameters of their own.")
+    private boolean useGlobalSslContextParameters;
 
     public BonitaComponent() {
     }
@@ -46,6 +53,19 @@ public class BonitaComponent extends DefaultComponent {
 
         BonitaEndpoint endpoint = new BonitaEndpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
+        if (configuration.getSslContextParameters() == null) {
+            
configuration.setSslContextParameters(retrieveGlobalSslContextParameters());
+        }
         return endpoint;
     }
+
+    @Override
+    public boolean isUseGlobalSslContextParameters() {
+        return this.useGlobalSslContextParameters;
+    }
+
+    @Override
+    public void setUseGlobalSslContextParameters(boolean 
useGlobalSslContextParameters) {
+        this.useGlobalSslContextParameters = useGlobalSslContextParameters;
+    }
 }
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
index 6c64a1660a76..9b4fa0be0bbb 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
@@ -23,6 +23,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.jsse.SSLContextParameters;
 
 @UriParams
 public class BonitaConfiguration implements Cloneable {
@@ -31,6 +32,12 @@ public class BonitaConfiguration implements Cloneable {
                            + " process that the processName option names, with 
the contract inputs from the message body.")
     @Metadata(required = true)
     private BonitaOperation operation;
+    @UriParam(description = "The protocol of the REST API of the Bonita 
server: http, or https to send the login, the"
+                            + " session cookies and the requests over TLS. 
With https, set the port to the HTTPS port of"
+                            + " the server, and the sslContextParameters 
option when the JVM does not trust the"
+                            + " certificate of the server.",
+              enums = "http,https", defaultValue = "http")
+    private String protocol = "http";
     @UriParam(description = "The host name of the Bonita server. The producer 
calls the REST API under the"
                             + " /bonita context path of this host.",
               defaultValue = "localhost")
@@ -49,6 +56,11 @@ public class BonitaConfiguration implements Cloneable {
                             + " Bonita before each request, and fails if it is 
not set.",
               label = "security", security = "secret")
     private String password;
+    @UriParam(description = "The SSL configuration of the HTTPS connections to 
the Bonita server, such as the trust store"
+                            + " with the certificate of the server. It is used 
only when the protocol is https; without it"
+                            + " the default SSL context of the JVM is used.",
+              label = "security")
+    private SSLContextParameters sslContextParameters;
 
     public String getHostname() {
         return hostname;
@@ -58,6 +70,14 @@ public class BonitaConfiguration implements Cloneable {
         this.hostname = hostname;
     }
 
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
+
     public String getPort() {
         return port;
     }
@@ -111,4 +131,12 @@ public class BonitaConfiguration implements Cloneable {
         this.password = password;
     }
 
+    public SSLContextParameters getSslContextParameters() {
+        return sslContextParameters;
+    }
+
+    public void setSslContextParameters(SSLContextParameters 
sslContextParameters) {
+        this.sslContextParameters = sslContextParameters;
+    }
+
 }
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPIBuilder.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPIBuilder.java
index 03aec878d397..ac811158f3c9 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPIBuilder.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPIBuilder.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.bonita.api;
 
 import jakarta.ws.rs.client.Client;
-import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.client.WebTarget;
 
 import org.apache.camel.component.bonita.api.filter.BonitaAuthFilter;
@@ -31,20 +30,23 @@ public class BonitaAPIBuilder {
     }
 
     /**
-     * Builds an API that sends its requests with a new JAX-RS client. Nothing 
closes that client; a caller that uses
-     * the API for a while should use {@link #build(BonitaAPIConfig, Client)} 
with a client that it closes.
+     * Builds an API that sends its requests with a new JAX-RS client, created 
with {@link BonitaAPIConfig#newClient()}.
+     * Nothing closes that client; a caller that uses the API for a while 
should use
+     * {@link #build(BonitaAPIConfig, Client)} with a client that it closes.
      */
     public static BonitaAPI build(BonitaAPIConfig bonitaAPIConfig) {
         if (bonitaAPIConfig == null) {
             throw new IllegalArgumentException("bonitaApiConfig is null");
         }
-        return build(bonitaAPIConfig, ClientBuilder.newBuilder().build());
+        return build(bonitaAPIConfig, bonitaAPIConfig.newClient());
     }
 
     /**
      * Builds an API that sends its requests with the given JAX-RS client. The 
JSON provider and the login filter of the
      * configuration are registered on the client, and the file inputs of a 
case are uploaded with it too. The client
-     * stays with the caller, which closes it when the API is no longer used.
+     * stays with the caller, which closes it when the API is no longer used. 
For https the caller builds the client
+     * with the SSL context to use (such as with {@link 
BonitaAPIConfig#newClient()}); the login filter creates its
+     * clients with {@link BonitaAPIConfig#newClient()}.
      */
     public static BonitaAPI build(BonitaAPIConfig bonitaAPIConfig, Client 
client) {
         if (bonitaAPIConfig == null) {
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/filter/BonitaAuthFilter.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/filter/BonitaAuthFilter.java
index 4574a4e0052f..09f0adbb558f 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/filter/BonitaAuthFilter.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/filter/BonitaAuthFilter.java
@@ -21,7 +21,6 @@ import java.util.ArrayList;
 import java.util.Map;
 
 import jakarta.ws.rs.client.Client;
-import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.client.ClientRequestContext;
 import jakarta.ws.rs.client.ClientRequestFilter;
 import jakarta.ws.rs.client.Entity;
@@ -55,8 +54,7 @@ public class BonitaAuthFilter implements ClientRequestFilter {
             if (ObjectHelper.isEmpty(password)) {
                 throw new IllegalArgumentException("Password provided is null 
or empty.");
             }
-            ClientBuilder clientBuilder = ClientBuilder.newBuilder();
-            Client client = clientBuilder.build();
+            Client client = bonitaApiConfig.newClient();
             // a client for this login only: it is closed when the cookies of 
the answer are read
             try {
                 WebTarget webTarget = 
client.target(bonitaApiConfig.getBaseBonitaURI()).path("loginservice");
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
index aaf95aa17f87..dbb423cffd57 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
@@ -16,8 +16,20 @@
  */
 package org.apache.camel.component.bonita.api.util;
 
+import java.util.Locale;
+
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+
+import javax.net.ssl.SSLContext;
+
 public class BonitaAPIConfig {
 
+    public static final String HTTP = "http";
+    public static final String HTTPS = "https";
+
+    private String protocol = HTTP;
+    private SSLContext sslContext;
     private String hostname;
     private String port;
     private String username;
@@ -31,7 +43,7 @@ public class BonitaAPIConfig {
     }
 
     public String getBaseBonitaURI() {
-        return "http://"; + hostname + ":" + port + "/bonita";
+        return protocol + "://" + hostname + ":" + port + "/bonita";
     }
 
     public String getProcessFileUploadBaseURI(String processName, String 
processVersion) {
@@ -39,6 +51,51 @@ public class BonitaAPIConfig {
                + "/API/formFileUpload";
     }
 
+    /**
+     * Creates a new JAX-RS client for the Bonita server of this 
configuration, with the {@link #getSslContext() SSL
+     * context} of this configuration when it has one. The caller closes the 
client.
+     */
+    public Client newClient() {
+        ClientBuilder builder = ClientBuilder.newBuilder();
+        if (sslContext != null) {
+            builder = builder.sslContext(sslContext);
+        }
+        return builder.build();
+    }
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    /**
+     * The protocol of the URIs of the Bonita server: http or https (in any 
case); null is http.
+     *
+     * @throws IllegalArgumentException for any other protocol
+     */
+    public void setProtocol(String protocol) {
+        if (protocol == null) {
+            this.protocol = HTTP;
+            return;
+        }
+        String value = protocol.trim().toLowerCase(Locale.ROOT);
+        if (!HTTP.equals(value) && !HTTPS.equals(value)) {
+            throw new IllegalArgumentException(
+                    "The protocol of the Bonita server must be http or https, 
but is: " + protocol);
+        }
+        this.protocol = value;
+    }
+
+    public SSLContext getSslContext() {
+        return sslContext;
+    }
+
+    /**
+     * The SSL context of the clients that {@link #newClient()} creates; null 
uses the default SSL context of the JVM.
+     */
+    public void setSslContext(SSLContext sslContext) {
+        this.sslContext = sslContext;
+    }
+
     public String getHostname() {
         return hostname;
     }
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIUtil.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIUtil.java
index da4411af43cd..2768f71c8eaf 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIUtil.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIUtil.java
@@ -24,7 +24,6 @@ import java.util.Map.Entry;
 import java.util.concurrent.ThreadLocalRandom;
 
 import jakarta.ws.rs.client.Client;
-import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.client.WebTarget;
 import jakarta.ws.rs.core.MediaType;
 
@@ -56,8 +55,7 @@ public class BonitaAPIUtil {
      */
     @Deprecated(since = "4.24.0")
     public static BonitaAPIUtil getInstance(BonitaAPIConfig bonitaAPIConfig) {
-        ClientBuilder clientBuilder = ClientBuilder.newBuilder();
-        Client client = clientBuilder.build();
+        Client client = bonitaAPIConfig.newClient();
         client.register(jsonProvider());
         client.register(new BonitaAuthFilter(bonitaAPIConfig));
         return forClient(client, bonitaAPIConfig);
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
index b1b80180e2c1..0e7fa7b7a7f9 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
@@ -21,7 +21,6 @@ import java.util.Locale;
 import java.util.Map;
 
 import jakarta.ws.rs.client.Client;
-import jakarta.ws.rs.client.ClientBuilder;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.InvalidPayloadException;
@@ -34,6 +33,7 @@ import org.apache.camel.component.bonita.api.BonitaAPIBuilder;
 import org.apache.camel.component.bonita.api.model.CaseCreationResponse;
 import org.apache.camel.component.bonita.api.model.ProcessDefinitionResponse;
 import org.apache.camel.component.bonita.api.util.BonitaAPIConfig;
+import org.apache.camel.support.jsse.SSLContextParameters;
 import tools.jackson.core.JacksonException;
 import tools.jackson.databind.JsonNode;
 import tools.jackson.databind.ObjectMapper;
@@ -54,13 +54,19 @@ public class BonitaStartProducer extends BonitaProducer {
     @Override
     protected void doStart() throws Exception {
         super.doStart();
-        // Setup access type (HTTP on local host)
         String hostname = this.configuration.getHostname();
         String port = this.configuration.getPort();
         String username = this.configuration.getUsername();
         String password = this.configuration.getPassword();
         BonitaAPIConfig bonitaAPIConfig = new BonitaAPIConfig(hostname, port, 
username, password);
-        client = ClientBuilder.newBuilder().build();
+        // fails the start for a protocol that is not http or https
+        bonitaAPIConfig.setProtocol(this.configuration.getProtocol());
+        SSLContextParameters sslContextParameters = 
this.configuration.getSslContextParameters();
+        if (BonitaAPIConfig.HTTPS.equals(bonitaAPIConfig.getProtocol()) && 
sslContextParameters != null) {
+            // the client of the producer and the clients of the logins use 
this SSL context
+            
bonitaAPIConfig.setSslContext(sslContextParameters.createSSLContext(getEndpoint().getCamelContext()));
+        }
+        client = bonitaAPIConfig.newClient();
         bonitaApi = BonitaAPIBuilder.build(bonitaAPIConfig, client);
     }
 
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaHttpsTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaHttpsTest.java
new file mode 100644
index 000000000000..917c9bcbcf9a
--- /dev/null
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaHttpsTest.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.bonita;
+
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.net.ssl.SSLException;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.FailedToStartRouteException;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.jsse.KeyStoreParameters;
+import org.apache.camel.support.jsse.SSLContextParameters;
+import org.apache.camel.support.jsse.TrustManagersParameters;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * The producer with protocol=https: the login, the process lookup and the 
case creation go to a server that only
+ * accepts HTTPS, with the SSL context of the sslContextParameters option (or 
the global one of the component). The
+ * certificate of the server (jsse/localhost.p12, for DNS:localhost) is not 
trusted by the JVM, so without the SSL
+ * context of the endpoint the first request (the login) fails.
+ */
+class BonitaHttpsTest {
+
+    private static final String KEYSTORE = "jsse/localhost.p12";
+    private static final String LOGIN = "/bonita/loginservice";
+    private static final String PROCESS = "/bonita/API/bpm/process";
+    private static final String INSTANTIATION = 
"/bonita/API/bpm/process/7/instantiation";
+
+    private WireMockServer server;
+    private CamelContext context;
+
+    @BeforeEach
+    void setup() throws Exception {
+        Path keystore = 
Path.of(BonitaHttpsTest.class.getClassLoader().getResource(KEYSTORE).toURI());
+        server = new WireMockServer(
+                
WireMockConfiguration.options().httpDisabled(true).dynamicHttpsPort()
+                        
.keystorePath(keystore.toString()).keystoreType("PKCS12")
+                        
.keystorePassword("changeit").keyManagerPassword("changeit"));
+        server.start();
+        server.stubFor(post(urlEqualTo(LOGIN))
+                .willReturn(aResponse().withHeader("Set-Cookie", 
"JSESSIONID=session", "X-Bonita-API-Token=token")));
+        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("s", 
equalTo("orders"))
+                .willReturn(aResponse().withHeader("Content-Type", 
"application/json")
+                        
.withBody("[{\"id\":\"7\",\"name\":\"orders\",\"version\":\"1.0\"}]")));
+        server.stubFor(post(urlEqualTo(INSTANTIATION))
+                .willReturn(aResponse().withHeader("Content-Type", 
"application/json").withBody("{\"caseId\":\"1\"}")));
+
+        context = new DefaultCamelContext();
+        context.getRegistry().bind("ssl", trustServer());
+    }
+
+    @AfterEach
+    void tearDown() {
+        if (context != null) {
+            context.stop();
+        }
+        if (server != null) {
+            server.stop();
+        }
+    }
+
+    @Test
+    void startCaseOverHttpsWithTheSslContextParametersOfTheEndpoint() throws 
Exception {
+        startRoute("protocol=https&sslContextParameters=#ssl");
+
+        Exchange exchange = startCase();
+
+        assertNull(exchange.getException(), "exception of the exchange");
+        assertEquals("1", 
exchange.getMessage().getHeader(BonitaConstants.CASE_ID));
+        assertEquals(2, 
server.findAll(anyRequestedFor(urlEqualTo(LOGIN))).size(), "logins over https");
+        assertEquals(1, 
server.findAll(anyRequestedFor(urlEqualTo(INSTANTIATION))).size(), "cases 
started");
+    }
+
+    @Test
+    void protocolIsCaseInsensitive() throws Exception {
+        startRoute("protocol=HTTPS&sslContextParameters=#ssl");
+
+        Exchange exchange = startCase();
+
+        assertNull(exchange.getException(), "exception of the exchange");
+        assertEquals("1", 
exchange.getMessage().getHeader(BonitaConstants.CASE_ID));
+    }
+
+    @Test
+    void startCaseOverHttpsWithTheGlobalSslContextParameters() throws 
Exception {
+        context.setSSLContextParameters(trustServer());
+        BonitaComponent component = new BonitaComponent();
+        component.setUseGlobalSslContextParameters(true);
+        context.addComponent("bonita", component);
+        startRoute("protocol=https");
+
+        Exchange exchange = startCase();
+
+        assertNull(exchange.getException(), "exception of the exchange");
+        assertEquals("1", 
exchange.getMessage().getHeader(BonitaConstants.CASE_ID));
+    }
+
+    @Test
+    void loginFailsWithoutTheSslContextOfTheEndpoint() throws Exception {
+        startRoute("protocol=https");
+
+        Exchange exchange = startCase();
+
+        assertNotNull(exchange.getException(), "the JVM does not trust the 
certificate of the server");
+        assertTrue(hasCause(exchange.getException(), SSLException.class),
+                "an SSLException in the causes of " + exchange.getException());
+        assertEquals(0, 
server.findAll(anyRequestedFor(urlEqualTo(INSTANTIATION))).size(), "cases 
started");
+    }
+
+    @Test
+    void otherProtocolFailsTheStart() throws Exception {
+        context.addRoutes(route("protocol=ftp"));
+
+        Exception e = assertThrows(FailedToStartRouteException.class, 
context::start);
+
+        IllegalArgumentException cause = findCause(e, 
IllegalArgumentException.class);
+        assertNotNull(cause, "an IllegalArgumentException in the causes of " + 
e);
+        assertEquals("The protocol of the Bonita server must be http or https, 
but is: ftp", cause.getMessage());
+    }
+
+    private void startRoute(String options) throws Exception {
+        context.addRoutes(route(options));
+        context.start();
+    }
+
+    private RouteBuilder route(String options) {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                from("direct:start")
+                        .to("bonita:startCase?hostname=localhost&port=" + 
server.httpsPort()
+                            + 
"&processName=orders&username=user&password=pass&" + options);
+            }
+        };
+    }
+
+    private Exchange startCase() {
+        ProducerTemplate template = context.createProducerTemplate();
+        try {
+            Map<String, Object> inputs = new HashMap<>();
+            inputs.put("amount", 1);
+            return template.send("direct:start", e -> 
e.getIn().setBody(inputs));
+        } finally {
+            template.stop();
+        }
+    }
+
+    private static SSLContextParameters trustServer() {
+        KeyStoreParameters truststore = new KeyStoreParameters();
+        truststore.setResource(KEYSTORE);
+        truststore.setPassword("changeit");
+        truststore.setType("PKCS12");
+        TrustManagersParameters trustManagers = new TrustManagersParameters();
+        trustManagers.setKeyStore(truststore);
+        SSLContextParameters parameters = new SSLContextParameters();
+        parameters.setTrustManagers(trustManagers);
+        return parameters;
+    }
+
+    private static boolean hasCause(Throwable e, Class<? extends Throwable> 
type) {
+        return findCause(e, type) != null;
+    }
+
+    private static <T extends Throwable> T findCause(Throwable e, Class<T> 
type) {
+        for (Throwable t = e; t != null; t = t.getCause()) {
+            if (type.isInstance(t)) {
+                return assertInstanceOf(type, t);
+            }
+        }
+        return null;
+    }
+}
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
index bb9b4842227c..358d3f805a45 100644
--- 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.bonita.api.util;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class BonitaAPIConfigTest {
 
@@ -28,4 +29,28 @@ public class BonitaAPIConfigTest {
         assertEquals("http://host:port/bonita";, config.getBaseBonitaURI());
     }
 
+    @Test
+    public void testBaseBonitaURLWithHttps() {
+        BonitaAPIConfig config = new BonitaAPIConfig("host", "port", 
"username", "password");
+        config.setProtocol("https");
+        assertEquals("https://host:port/bonita";, config.getBaseBonitaURI());
+    }
+
+    @Test
+    public void testProtocolIsCaseInsensitiveAndNullIsHttp() {
+        BonitaAPIConfig config = new BonitaAPIConfig("host", "port", 
"username", "password");
+        config.setProtocol("HTTPS");
+        assertEquals("https", config.getProtocol());
+        config.setProtocol(null);
+        assertEquals("http://host:port/bonita";, config.getBaseBonitaURI());
+    }
+
+    @Test
+    public void testOtherProtocolIsRefused() {
+        BonitaAPIConfig config = new BonitaAPIConfig("host", "port", 
"username", "password");
+        IllegalArgumentException e = 
assertThrows(IllegalArgumentException.class, () -> config.setProtocol("ftp"));
+        assertEquals("The protocol of the Bonita server must be http or https, 
but is: ftp", e.getMessage());
+        assertEquals("http", config.getProtocol());
+    }
+
 }
diff --git a/components/camel-bonita/src/test/resources/jsse/localhost.p12 
b/components/camel-bonita/src/test/resources/jsse/localhost.p12
new file mode 100644
index 000000000000..4ef81f6d3489
Binary files /dev/null and 
b/components/camel-bonita/src/test/resources/jsse/localhost.p12 differ
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BonitaComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BonitaComponentBuilderFactory.java
index 4bac2ec74bc1..f206f245c566 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BonitaComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BonitaComponentBuilderFactory.java
@@ -96,6 +96,24 @@ public interface BonitaComponentBuilderFactory {
             doSetProperty("autowiredEnabled", autowiredEnabled);
             return this;
         }
+    
+        
+        /**
+         * Enable usage of global SSL context parameters, for the endpoints 
with
+         * the https protocol that have no sslContextParameters of their own.
+         * 
+         * 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 BonitaComponentBuilder useGlobalSslContextParameters(boolean 
useGlobalSslContextParameters) {
+            doSetProperty("useGlobalSslContextParameters", 
useGlobalSslContextParameters);
+            return this;
+        }
     }
 
     class BonitaComponentBuilderImpl
@@ -113,6 +131,7 @@ public interface BonitaComponentBuilderFactory {
             switch (name) {
             case "lazyStartProducer": ((BonitaComponent) 
component).setLazyStartProducer((boolean) value); return true;
             case "autowiredEnabled": ((BonitaComponent) 
component).setAutowiredEnabled((boolean) value); return true;
+            case "useGlobalSslContextParameters": ((BonitaComponent) 
component).setUseGlobalSslContextParameters((boolean) value); return true;
             default: return false;
             }
         }
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
index 014bd5839dbe..60a9b7b01632 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
@@ -91,6 +91,25 @@ public interface BonitaEndpointBuilderFactory {
             doSetProperty("processName", processName);
             return this;
         }
+        /**
+         * The protocol of the REST API of the Bonita server: http, or https to
+         * send the login, the session cookies and the requests over TLS. With
+         * https, set the port to the HTTPS port of the server, and the
+         * sslContextParameters option when the JVM does not trust the
+         * certificate of the server.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Default: http
+         * Group: producer
+         * 
+         * @param protocol the value to set
+         * @return the dsl builder
+         */
+        default BonitaEndpointBuilder protocol(String protocol) {
+            doSetProperty("protocol", protocol);
+            return this;
+        }
         /**
          * The password of the Bonita account. The producer logs in with it at
          * the loginservice of Bonita before each request, and fails if it is
@@ -107,6 +126,42 @@ public interface BonitaEndpointBuilderFactory {
             doSetProperty("password", password);
             return this;
         }
+        /**
+         * The SSL configuration of the HTTPS connections to the Bonita server,
+         * such as the trust store with the certificate of the server. It is
+         * used only when the protocol is https; without it the default SSL
+         * context of the JVM is used.
+         * 
+         * 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 BonitaEndpointBuilder 
sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
+        /**
+         * The SSL configuration of the HTTPS connections to the Bonita server,
+         * such as the trust store with the certificate of the server. It is
+         * used only when the protocol is https; without it the default SSL
+         * context of the JVM is used.
+         * 
+         * 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 BonitaEndpointBuilder sslContextParameters(String 
sslContextParameters) {
+            doSetProperty("sslContextParameters", sslContextParameters);
+            return this;
+        }
         /**
          * The username of the Bonita account. The producer logs in with it at
          * the loginservice of Bonita before each request, and fails if it is

Reply via email to