This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new a7b8d8d66b2d CAMEL-27207, CAMEL-27196: camel-pulsar - check the host
name of the broker with pulsar+ssl, and add tlsTrustCertsFilePath (#30350)
a7b8d8d66b2d is described below
commit a7b8d8d66b2d180ffbc3763e8149605840d87111
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 09:03:23 2026 +0100
CAMEL-27207, CAMEL-27196: camel-pulsar - check the host name of the broker
with pulsar+ssl, and add tlsTrustCertsFilePath (#30350)
When the endpoint creates its own Pulsar client, the client kept the
default of the Pulsar client, which does not check that the certificate
of the broker was issued for the host. A new hostnameVerification option
(default true, like camel-smpp, camel-mina, camel-mllp and camel-nats)
turns the check on, and a new tlsTrustCertsFilePath option sets a PEM
file with the certificate authorities to trust.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../apache/camel/catalog/components/pulsar.json | 8 +-
.../pulsar/PulsarComponentConfigurer.java | 12 ++
.../component/pulsar/PulsarEndpointConfigurer.java | 12 ++
.../component/pulsar/PulsarEndpointUriFactory.java | 4 +-
.../org/apache/camel/component/pulsar/pulsar.json | 8 +-
.../component/pulsar/PulsarConfiguration.java | 30 ++++
.../camel/component/pulsar/PulsarEndpoint.java | 5 +
.../pulsar/PulsarHostnameVerificationTest.java | 146 +++++++++++++++++++
.../apache/camel/component/pulsar/hostname/ca.pem | 37 +++++
.../camel/component/pulsar/hostname/other.p12 | Bin 0 -> 2616 bytes
.../camel/component/pulsar/hostname/server.p12 | Bin 0 -> 2584 bytes
.../java/org/apache/camel/util/SecurityUtils.java | 1 +
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 15 ++
.../dsl/PulsarComponentBuilderFactory.java | 40 ++++++
.../endpoint/dsl/PulsarEndpointBuilderFactory.java | 159 +++++++++++++++++++++
15 files changed, 472 insertions(+), 5 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pulsar.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pulsar.json
index 387c4e42596a..ac0396f1cdcf 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pulsar.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pulsar.json
@@ -74,7 +74,9 @@
"allowJavaSerializedObject": { "index": 47, "kind": "property",
"displayName": "Allow Java Serialized Object", "group": "producer (advanced)",
"label": "producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": true, "deprecationNote": "Java serialization of the
body is kept only for compatibility, and will be removed: marshal the body
before sending it", "autowired": false, "secret": false, "security":
"insecure:serialization", "defaultValue": fa [...]
"autoConfiguration": { "index": 48, "kind": "property", "displayName":
"Auto Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.pulsar.utils.AutoConfiguration", "deprecated":
false, "autowired": false, "secret": false, "description": "The pulsar auto
configuration" },
"autowiredEnabled": { "index": 49, "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 [...]
- "pulsarClient": { "index": 50, "kind": "property", "displayName": "Pulsar
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.pulsar.client.api.PulsarClient",
"deprecated": false, "autowired": true, "secret": false, "description": "The
pulsar client" }
+ "pulsarClient": { "index": 50, "kind": "property", "displayName": "Pulsar
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.pulsar.client.api.PulsarClient",
"deprecated": false, "autowired": true, "secret": false, "description": "The
pulsar client" },
+ "hostnameVerification": { "index": 51, "kind": "property", "displayName":
"Hostname Verification", "group": "security", "label": "security", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "security": "insecure:ssl",
"insecureValue": "false", "defaultValue": true, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"configuration", "description": "Whether to check t [...]
+ "tlsTrustCertsFilePath": { "index": 52, "kind": "property", "displayName":
"Tls Trust Certs File Path", "group": "security", "label": "security",
"required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"configuration", "description": "The path of a PEM file with the certificates
of the certificate authorities to tr [...]
},
"headers": {
"properties": { "index": 0, "kind": "header", "displayName": "", "group":
"consumer", "label": "consumer", "required": false, "javaType": "Map<String,
String>", "deprecated": false, "autowired": false, "secret": false,
"description": "The properties attached to the message.", "constantName":
"org.apache.camel.component.pulsar.utils.message.PulsarMessageHeaders#PROPERTIES"
},
@@ -152,7 +154,9 @@
"producerName": { "index": 48, "kind": "parameter", "displayName":
"Producer Name", "group": "producer", "label": "producer", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Name of the producer. If unset, lets
Pulsar select a unique identifier." },
"sendTimeoutMs": { "index": 49, "kind": "parameter", "displayName": "Send
Timeout Ms", "group": "producer", "label": "producer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 30000, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Send timeout in milliseconds" },
"allowJavaSerializedObject": { "index": 50, "kind": "parameter",
"displayName": "Allow Java Serialized Object", "group": "producer (advanced)",
"label": "producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": true, "deprecationNote": "Java serialization of the
body is kept only for compatibility, and will be removed: marshal the body
before sending it", "autowired": false, "secret": false, "security":
"insecure:serialization", "defaultValue": f [...]
- "lazyStartProducer": { "index": 51, "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 produ [...]
+ "lazyStartProducer": { "index": 51, "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 produ [...]
+ "hostnameVerification": { "index": 52, "kind": "parameter", "displayName":
"Hostname Verification", "group": "security", "label": "security", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "security": "insecure:ssl",
"insecureValue": "false", "defaultValue": true, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Whether to [...]
+ "tlsTrustCertsFilePath": { "index": 53, "kind": "parameter",
"displayName": "Tls Trust Certs File Path", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.pulsar.PulsarConfiguration",
"configurationField": "pulsarConfiguration", "description": "The path of a PEM
file with the certificates of the certificate authoritie [...]
},
"dstWorlds": {
"PulsarWorld": { "javaType":
"org.apache.camel.component.pulsar.dst.PulsarWorld", "fake": "FakePulsar: a
broker and client for one topic and one durable subscription", "covers": [
"subscription types Exclusive, Shared, Failover and Key_Shared with one to
three consumers", "the message listener (messageListener=true, one consumer
thread)", "the ack timeout and the redelivery of a failed exchange after a
negative acknowledgement", "route start, restart, suspend and resume", "an
asynchr [...]
diff --git
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarComponentConfigurer.java
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarComponentConfigurer.java
index dbf5e5185798..50786cb010d2 100644
---
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarComponentConfigurer.java
+++
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarComponentConfigurer.java
@@ -80,6 +80,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "enableRetry":
getOrCreateConfiguration(target).setEnableRetry(property(camelContext,
boolean.class, value)); return true;
case "hashingscheme":
case "hashingScheme":
getOrCreateConfiguration(target).setHashingScheme(property(camelContext,
java.lang.String.class, value)); return true;
+ case "hostnameverification":
+ case "hostnameVerification":
getOrCreateConfiguration(target).setHostnameVerification(property(camelContext,
boolean.class, value)); return true;
case "initialsequenceid":
case "initialSequenceId":
getOrCreateConfiguration(target).setInitialSequenceId(property(camelContext,
long.class, value)); return true;
case "keysharedpolicy":
@@ -130,6 +132,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "subscriptionTopicsMode":
getOrCreateConfiguration(target).setSubscriptionTopicsMode(property(camelContext,
org.apache.pulsar.client.api.RegexSubscriptionMode.class, value)); return true;
case "subscriptiontype":
case "subscriptionType":
getOrCreateConfiguration(target).setSubscriptionType(property(camelContext,
org.apache.camel.component.pulsar.utils.consumers.SubscriptionType.class,
value)); return true;
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath":
getOrCreateConfiguration(target).setTlsTrustCertsFilePath(property(camelContext,
java.lang.String.class, value)); return true;
case "topicspattern":
case "topicsPattern":
getOrCreateConfiguration(target).setTopicsPattern(property(camelContext,
boolean.class, value)); return true;
default: return false;
@@ -193,6 +197,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "enableRetry": return boolean.class;
case "hashingscheme":
case "hashingScheme": return java.lang.String.class;
+ case "hostnameverification":
+ case "hostnameVerification": return boolean.class;
case "initialsequenceid":
case "initialSequenceId": return long.class;
case "keysharedpolicy":
@@ -243,6 +249,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "subscriptionTopicsMode": return
org.apache.pulsar.client.api.RegexSubscriptionMode.class;
case "subscriptiontype":
case "subscriptionType": return
org.apache.camel.component.pulsar.utils.consumers.SubscriptionType.class;
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath": return java.lang.String.class;
case "topicspattern":
case "topicsPattern": return boolean.class;
default: return null;
@@ -302,6 +310,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "enableRetry": return
getOrCreateConfiguration(target).isEnableRetry();
case "hashingscheme":
case "hashingScheme": return
getOrCreateConfiguration(target).getHashingScheme();
+ case "hostnameverification":
+ case "hostnameVerification": return
getOrCreateConfiguration(target).isHostnameVerification();
case "initialsequenceid":
case "initialSequenceId": return
getOrCreateConfiguration(target).getInitialSequenceId();
case "keysharedpolicy":
@@ -352,6 +362,8 @@ public class PulsarComponentConfigurer extends
PropertyConfigurerSupport impleme
case "subscriptionTopicsMode": return
getOrCreateConfiguration(target).getSubscriptionTopicsMode();
case "subscriptiontype":
case "subscriptionType": return
getOrCreateConfiguration(target).getSubscriptionType();
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath": return
getOrCreateConfiguration(target).getTlsTrustCertsFilePath();
case "topicspattern":
case "topicsPattern": return
getOrCreateConfiguration(target).isTopicsPattern();
default: return null;
diff --git
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointConfigurer.java
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointConfigurer.java
index b4b1c1806fe8..966e931bc712 100644
---
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointConfigurer.java
+++
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointConfigurer.java
@@ -72,6 +72,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "exchangePattern":
target.setExchangePattern(property(camelContext,
org.apache.camel.ExchangePattern.class, value)); return true;
case "hashingscheme":
case "hashingScheme":
target.getPulsarConfiguration().setHashingScheme(property(camelContext,
java.lang.String.class, value)); return true;
+ case "hostnameverification":
+ case "hostnameVerification":
target.getPulsarConfiguration().setHostnameVerification(property(camelContext,
boolean.class, value)); return true;
case "initialsequenceid":
case "initialSequenceId":
target.getPulsarConfiguration().setInitialSequenceId(property(camelContext,
long.class, value)); return true;
case "keysharedpolicy":
@@ -118,6 +120,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "subscriptionTopicsMode":
target.getPulsarConfiguration().setSubscriptionTopicsMode(property(camelContext,
org.apache.pulsar.client.api.RegexSubscriptionMode.class, value)); return true;
case "subscriptiontype":
case "subscriptionType":
target.getPulsarConfiguration().setSubscriptionType(property(camelContext,
org.apache.camel.component.pulsar.utils.consumers.SubscriptionType.class,
value)); return true;
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath":
target.getPulsarConfiguration().setTlsTrustCertsFilePath(property(camelContext,
java.lang.String.class, value)); return true;
case "topicspattern":
case "topicsPattern":
target.getPulsarConfiguration().setTopicsPattern(property(camelContext,
boolean.class, value)); return true;
default: return false;
@@ -175,6 +179,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "exchangePattern": return org.apache.camel.ExchangePattern.class;
case "hashingscheme":
case "hashingScheme": return java.lang.String.class;
+ case "hostnameverification":
+ case "hostnameVerification": return boolean.class;
case "initialsequenceid":
case "initialSequenceId": return long.class;
case "keysharedpolicy":
@@ -221,6 +227,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "subscriptionTopicsMode": return
org.apache.pulsar.client.api.RegexSubscriptionMode.class;
case "subscriptiontype":
case "subscriptionType": return
org.apache.camel.component.pulsar.utils.consumers.SubscriptionType.class;
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath": return java.lang.String.class;
case "topicspattern":
case "topicsPattern": return boolean.class;
default: return null;
@@ -279,6 +287,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "exchangePattern": return target.getExchangePattern();
case "hashingscheme":
case "hashingScheme": return
target.getPulsarConfiguration().getHashingScheme();
+ case "hostnameverification":
+ case "hostnameVerification": return
target.getPulsarConfiguration().isHostnameVerification();
case "initialsequenceid":
case "initialSequenceId": return
target.getPulsarConfiguration().getInitialSequenceId();
case "keysharedpolicy":
@@ -325,6 +335,8 @@ public class PulsarEndpointConfigurer extends
PropertyConfigurerSupport implemen
case "subscriptionTopicsMode": return
target.getPulsarConfiguration().getSubscriptionTopicsMode();
case "subscriptiontype":
case "subscriptionType": return
target.getPulsarConfiguration().getSubscriptionType();
+ case "tlstrustcertsfilepath":
+ case "tlsTrustCertsFilePath": return
target.getPulsarConfiguration().getTlsTrustCertsFilePath();
case "topicspattern":
case "topicsPattern": return
target.getPulsarConfiguration().isTopicsPattern();
default: return null;
diff --git
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointUriFactory.java
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointUriFactory.java
index e41d972bf0a7..4383ad115715 100644
---
a/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointUriFactory.java
+++
b/components/camel-pulsar/src/generated/java/org/apache/camel/component/pulsar/PulsarEndpointUriFactory.java
@@ -24,7 +24,7 @@ public class PulsarEndpointUriFactory 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<>(52);
+ Set<String> props = new HashSet<>(54);
props.add("ackGroupTimeMillis");
props.add("ackTimeoutMillis");
props.add("ackTimeoutRedeliveryBackoff");
@@ -49,6 +49,7 @@ public class PulsarEndpointUriFactory extends
org.apache.camel.support.component
props.add("exceptionHandler");
props.add("exchangePattern");
props.add("hashingScheme");
+ props.add("hostnameVerification");
props.add("initialSequenceId");
props.add("keySharedPolicy");
props.add("lazyStartProducer");
@@ -75,6 +76,7 @@ public class PulsarEndpointUriFactory extends
org.apache.camel.support.component
props.add("subscriptionTopicsMode");
props.add("subscriptionType");
props.add("tenant");
+ props.add("tlsTrustCertsFilePath");
props.add("topic");
props.add("topicsPattern");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
diff --git
a/components/camel-pulsar/src/generated/resources/META-INF/org/apache/camel/component/pulsar/pulsar.json
b/components/camel-pulsar/src/generated/resources/META-INF/org/apache/camel/component/pulsar/pulsar.json
index 387c4e42596a..ac0396f1cdcf 100644
---
a/components/camel-pulsar/src/generated/resources/META-INF/org/apache/camel/component/pulsar/pulsar.json
+++
b/components/camel-pulsar/src/generated/resources/META-INF/org/apache/camel/component/pulsar/pulsar.json
@@ -74,7 +74,9 @@
"allowJavaSerializedObject": { "index": 47, "kind": "property",
"displayName": "Allow Java Serialized Object", "group": "producer (advanced)",
"label": "producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": true, "deprecationNote": "Java serialization of the
body is kept only for compatibility, and will be removed: marshal the body
before sending it", "autowired": false, "secret": false, "security":
"insecure:serialization", "defaultValue": fa [...]
"autoConfiguration": { "index": 48, "kind": "property", "displayName":
"Auto Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.pulsar.utils.AutoConfiguration", "deprecated":
false, "autowired": false, "secret": false, "description": "The pulsar auto
configuration" },
"autowiredEnabled": { "index": 49, "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 [...]
- "pulsarClient": { "index": 50, "kind": "property", "displayName": "Pulsar
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.pulsar.client.api.PulsarClient",
"deprecated": false, "autowired": true, "secret": false, "description": "The
pulsar client" }
+ "pulsarClient": { "index": 50, "kind": "property", "displayName": "Pulsar
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.pulsar.client.api.PulsarClient",
"deprecated": false, "autowired": true, "secret": false, "description": "The
pulsar client" },
+ "hostnameVerification": { "index": 51, "kind": "property", "displayName":
"Hostname Verification", "group": "security", "label": "security", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "security": "insecure:ssl",
"insecureValue": "false", "defaultValue": true, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"configuration", "description": "Whether to check t [...]
+ "tlsTrustCertsFilePath": { "index": 52, "kind": "property", "displayName":
"Tls Trust Certs File Path", "group": "security", "label": "security",
"required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"configuration", "description": "The path of a PEM file with the certificates
of the certificate authorities to tr [...]
},
"headers": {
"properties": { "index": 0, "kind": "header", "displayName": "", "group":
"consumer", "label": "consumer", "required": false, "javaType": "Map<String,
String>", "deprecated": false, "autowired": false, "secret": false,
"description": "The properties attached to the message.", "constantName":
"org.apache.camel.component.pulsar.utils.message.PulsarMessageHeaders#PROPERTIES"
},
@@ -152,7 +154,9 @@
"producerName": { "index": 48, "kind": "parameter", "displayName":
"Producer Name", "group": "producer", "label": "producer", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Name of the producer. If unset, lets
Pulsar select a unique identifier." },
"sendTimeoutMs": { "index": 49, "kind": "parameter", "displayName": "Send
Timeout Ms", "group": "producer", "label": "producer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 30000, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Send timeout in milliseconds" },
"allowJavaSerializedObject": { "index": 50, "kind": "parameter",
"displayName": "Allow Java Serialized Object", "group": "producer (advanced)",
"label": "producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": true, "deprecationNote": "Java serialization of the
body is kept only for compatibility, and will be removed: marshal the body
before sending it", "autowired": false, "secret": false, "security":
"insecure:serialization", "defaultValue": f [...]
- "lazyStartProducer": { "index": 51, "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 produ [...]
+ "lazyStartProducer": { "index": 51, "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 produ [...]
+ "hostnameVerification": { "index": 52, "kind": "parameter", "displayName":
"Hostname Verification", "group": "security", "label": "security", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "security": "insecure:ssl",
"insecureValue": "false", "defaultValue": true, "configurationClass":
"org.apache.camel.component.pulsar.PulsarConfiguration", "configurationField":
"pulsarConfiguration", "description": "Whether to [...]
+ "tlsTrustCertsFilePath": { "index": 53, "kind": "parameter",
"displayName": "Tls Trust Certs File Path", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.pulsar.PulsarConfiguration",
"configurationField": "pulsarConfiguration", "description": "The path of a PEM
file with the certificates of the certificate authoritie [...]
},
"dstWorlds": {
"PulsarWorld": { "javaType":
"org.apache.camel.component.pulsar.dst.PulsarWorld", "fake": "FakePulsar: a
broker and client for one topic and one durable subscription", "covers": [
"subscription types Exclusive, Shared, Failover and Key_Shared with one to
three consumers", "the message listener (messageListener=true, one consumer
thread)", "the ack timeout and the redelivery of a failed exchange after a
negative acknowledgement", "route start, restart, suspend and resume", "an
asynchr [...]
diff --git
a/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConfiguration.java
b/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConfiguration.java
index 598d98ccffa8..282c91ac405b 100644
---
a/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConfiguration.java
+++
b/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConfiguration.java
@@ -45,6 +45,10 @@ public class PulsarConfiguration implements Cloneable {
private String authenticationClass;
@UriParam(label = "common")
private String authenticationParams;
+ @UriParam(label = "security")
+ private String tlsTrustCertsFilePath;
+ @UriParam(label = "security", defaultValue = "true", security =
"insecure:ssl", insecureValue = "false")
+ private boolean hostnameVerification = true;
@UriParam(label = "consumer")
private boolean topicsPattern;
@UriParam(label = "consumer", defaultValue = "PersistentOnly", enums =
"PersistentOnly,NonPersistentOnly,AllTopics")
@@ -665,6 +669,32 @@ public class PulsarConfiguration implements Cloneable {
this.authenticationParams = authenticationParams;
}
+ public String getTlsTrustCertsFilePath() {
+ return tlsTrustCertsFilePath;
+ }
+
+ /**
+ * The path of a PEM file with the certificates of the certificate
authorities to trust, for a broker on
+ * pulsar+ssl:// whose certificate is not signed by an authority that the
JVM trusts. Not used when a pulsarClient
+ * is given.
+ */
+ public void setTlsTrustCertsFilePath(String tlsTrustCertsFilePath) {
+ this.tlsTrustCertsFilePath = tlsTrustCertsFilePath;
+ }
+
+ public boolean isHostnameVerification() {
+ return hostnameVerification;
+ }
+
+ /**
+ * Whether to check that the certificate of the broker matches the host
Camel connects to, with pulsar+ssl://. When
+ * disabled, any certificate trusted by the client is accepted, whatever
host it was issued for. Not used when a
+ * pulsarClient is given.
+ */
+ public void setHostnameVerification(boolean hostnameVerification) {
+ this.hostnameVerification = hostnameVerification;
+ }
+
public String getHashingScheme() {
return hashingScheme;
}
diff --git
a/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarEndpoint.java
b/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarEndpoint.java
index e11b289b8d22..9a0c23b4936d 100644
---
a/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarEndpoint.java
+++
b/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarEndpoint.java
@@ -187,6 +187,11 @@ public class PulsarEndpoint extends DefaultEndpoint
implements EndpointServiceLo
builder =
builder.authentication(pulsarConfiguration.getAuthenticationClass(),
pulsarConfiguration.getAuthenticationParams());
}
+ if
(ObjectHelper.isNotEmpty(pulsarConfiguration.getTlsTrustCertsFilePath())) {
+ builder =
builder.tlsTrustCertsFilePath(pulsarConfiguration.getTlsTrustCertsFilePath());
+ }
+ // the Pulsar client does not check the host name in the
certificate of the broker by default
+ builder =
builder.enableTlsHostnameVerification(pulsarConfiguration.isHostnameVerification());
pulsarClient = builder.build();
}
}
diff --git
a/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarHostnameVerificationTest.java
b/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarHostnameVerificationTest.java
new file mode 100644
index 000000000000..a4ae9157e057
--- /dev/null
+++
b/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarHostnameVerificationTest.java
@@ -0,0 +1,146 @@
+/*
+ * 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.pulsar;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetSocketAddress;
+import java.net.URL;
+import java.nio.file.Path;
+import java.security.KeyStore;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocket;
+import javax.net.ssl.SSLSocket;
+
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Connects with pulsar+ssl:// to localhost, to a local server whose
certificate is issued either for localhost or for
+ * another host name, to check that the host name in the certificate is
checked.
+ */
+public class PulsarHostnameVerificationTest extends CamelTestSupport {
+
+ private static final String RESOURCES =
"org/apache/camel/component/pulsar/hostname/";
+ private static final String PASSWORD = "changeit";
+ private static final long TIMEOUT_SECONDS = 20;
+
+ private final ExecutorService executor =
Executors.newSingleThreadExecutor();
+ private SSLServerSocket server;
+ private PulsarEndpoint endpoint;
+
+ @AfterEach
+ void stopServer() throws IOException {
+ // the endpoint does not close a client it built, and the client may
still try to connect
+ if (endpoint != null && endpoint.getPulsarClient() != null) {
+ endpoint.getPulsarClient().close();
+ }
+ if (server != null) {
+ server.close();
+ }
+ executor.shutdownNow();
+ }
+
+ @Test
+ void certificateForAnotherHostIsRefused() throws Exception {
+ CompletableFuture<Boolean> command = startServer("other.p12");
+
+ connect("");
+
+ assertFalse(command.get(TIMEOUT_SECONDS, TimeUnit.SECONDS),
+ "the certificate names another host, so the connection must
fail");
+ }
+
+ @Test
+ void certificateForTheHostIsAccepted() throws Exception {
+ CompletableFuture<Boolean> command = startServer("server.p12");
+
+ connect("");
+
+ assertTrue(command.get(TIMEOUT_SECONDS, TimeUnit.SECONDS), "the
certificate names the host");
+ }
+
+ @Test
+ void hostnameVerificationCanBeTurnedOff() throws Exception {
+ CompletableFuture<Boolean> command = startServer("other.p12");
+
+ connect("&hostnameVerification=false");
+
+ assertTrue(command.get(TIMEOUT_SECONDS, TimeUnit.SECONDS),
+ "without the host name check, a trusted certificate is
accepted for any host");
+ }
+
+ private void connect(String options) throws Exception {
+ URL ca = getClass().getClassLoader().getResource(RESOURCES + "ca.pem");
+ endpoint =
context.getEndpoint("pulsar:persistent://public/default/hostname?serviceUrl=RAW(pulsar+ssl://"
+ + "localhost:" + server.getLocalPort()
+ ")"
+ + "&tlsTrustCertsFilePath=" +
Path.of(ca.toURI())
+ + options,
+ PulsarEndpoint.class);
+ endpoint.start();
+ // the client connects when it is first used; the server is not a
broker, so this does not complete
+
endpoint.getPulsarClient().getPartitionsForTopic("persistent://public/default/hostname");
+ }
+
+ /**
+ * Starts a TLS server with the given certificate (server.p12 for
localhost, other.p12 for broker.example.org, both
+ * in ca.pem), for the first connection only.
+ *
+ * @return completes with whether the client sent its first command once
the TLS handshake was done
+ */
+ private CompletableFuture<Boolean> startServer(String certificate) throws
Exception {
+ KeyStore keyStore = KeyStore.getInstance("PKCS12");
+ try (InputStream is =
getClass().getClassLoader().getResourceAsStream(RESOURCES + certificate)) {
+ keyStore.load(is, PASSWORD.toCharArray());
+ }
+ KeyManagerFactory kmf =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+ kmf.init(keyStore, PASSWORD.toCharArray());
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(kmf.getKeyManagers(), null, null);
+
+ server = (SSLServerSocket)
sslContext.getServerSocketFactory().createServerSocket();
+ // localhost may connect to ::1 or 127.0.0.1
+ server.bind(new InetSocketAddress(0));
+ server.setSoTimeout((int) TimeUnit.SECONDS.toMillis(TIMEOUT_SECONDS));
+
+ CompletableFuture<Boolean> command = new CompletableFuture<>();
+ executor.submit(() -> {
+ try (SSLSocket socket = (SSLSocket) server.accept()) {
+ socket.setSoTimeout((int)
TimeUnit.SECONDS.toMillis(TIMEOUT_SECONDS));
+ try {
+ socket.startHandshake();
+ command.complete(socket.getInputStream().read() >= 0);
+ } catch (IOException e) {
+ command.complete(false);
+ }
+ } catch (Exception e) {
+ command.completeExceptionally(e);
+ }
+ });
+ return command;
+ }
+}
diff --git
a/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/ca.pem
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/ca.pem
new file mode 100644
index 000000000000..02c6bde97cdf
--- /dev/null
+++
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/ca.pem
@@ -0,0 +1,37 @@
+-----BEGIN CERTIFICATE-----
+MIIC4zCCAcugAwIBAgIINggiXRCZs14wDQYJKoZIhvcNAQEMBQAwFDESMBAGA1UE
+AxMJbG9jYWxob3N0MCAXDTI2MTExODIxNTQwMloYDzIxMjYxMDI1MjE1NDAyWjAU
+MRIwEAYDVQQDEwlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
+AoIBAQCIWovec8EOiNya8xHOsgUXRKsqpbj2Md0p5xJPWI2K7yUm6q1K7yT0nFLd
+guF/xsYQnKeysaYkTU+9+682gP5eVmYf5bxOCWdUXgY8+l8gHNQ0RlTwHovqIMo2
+R/Bnap7slSbnYoRaAwdkvDAxLXAfyC3oKY3TcmT3fJGBR6TqfBwMCV2pjVj3EwiK
+v9y6EDvYUmZnifzesDd90g8LrsHysd0kUbIvFkMNHAeVvwL+uD7WqKkypQCRUNBb
+OjbA/CIO4pE+mIKsT7Ho+7BwZd2UFrlsSDECP3iPSYp7+UcEn0c6GULqqaVt5q2E
+m5+RANGnShx6dWubcyNAHfLKNZuBAgMBAAGjNzA1MB0GA1UdDgQWBBS0Zu0OTqKZ
+PoLm7CmgQT/3biWfbDAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZIhvcNAQEM
+BQADggEBAB0EFUXUPbNQPZFrIb5/AqoXajrXd2Kwp5NkOTa+2DYtupvMwZjhay8m
+EGqcV0f/NutSweK4Flpi8u9l9ZY8FMSjsFebQFN+oh2L9dOJHnAbUgnJ1bQf8XjL
+OVr/7p6ETpIu4TecwV6U160GInruTcHn+aodQXdYT0Sylwo39SWouU9aRuhEbrWm
+Fge1GjY51sjGW5jchPRXTDSjO0CS8tJt2IS8X/vi/C37EMM2l3vpPkiXg0Q8g9il
++XG6+9Bnsf8Nl6NjjmmTkoA9AkaN05Iufwf4P6JCRKexMSilXjouJHZ47EAttzWK
+kSDlk1bRkrzzuL3110MdEmbLpieOgdI=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAeegAwIBAgIJAK7THVHNVxyeMA0GCSqGSIb3DQEBDAUAMB0xGzAZBgNV
+BAMTEmJyb2tlci5leGFtcGxlLm9yZzAgFw0yNjExMTgyMTU1NTVaGA8yMTI2MTAy
+NTIxNTU1NVowHTEbMBkGA1UEAxMSYnJva2VyLmV4YW1wbGUub3JnMIIBIjANBgkq
+hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAol3XJPzKyhouZl16jX5QRF7sLsgGZdsw
+AqYkDdoZLqGqk1DUiY4xwmRbpCZguLzYoyoVKL0HanyAH3PrmSrhOhEghBfqXXCY
+5+LUzHT4ji1G2okHddJzZYKeIh48iNKE3mctr4NsVPn0pQ4dJjFI+3FhUhVbP/9m
+Kv3OdlAj1rGHdQtIPcoD2rDbavZ6knOaeYI5f4GkfjouZF++5nSpta3GXY4TZvY7
+X5isYGfwZnWUSHem++HdAp4hKacwHX9UHPFOd7tFvGVq6CI2TovOzPryRHyltfD/
+PhzCXORIrRJGz5/ZxcgDTmH4s6IAtVA34KgpaLafEpFKdbzmpDlaXwIDAQABo0Aw
+PjAdBgNVHQ4EFgQU9g6NrL+PdGc4zd6HcxkxQWJk9wQwHQYDVR0RBBYwFIISYnJv
+a2VyLmV4YW1wbGUub3JnMA0GCSqGSIb3DQEBDAUAA4IBAQAqe91W4f9zLpjQ3PbI
+4qeNkL95Qgxvdiw/+Gb3ROiLPkEIfl79fgS/Qi1mB/htpd1gnMzK7M8b2Ucjwfh0
+cyvAxNjfMX8yZfsdYxj1e/xd9fCZ6qcqxzhtav6nmVmjHMPt4dlFkglnYRfYMzCQ
+a2J7vk2I4GcvlWBEQNrdDMZO0Uuuxcsq2KAi8XCwb80p+oo5p2XJ/uSElQoeOH3t
+1tC+eC8024PbKiHMl7btv8dX3y7ggdkRBRiuKhnYr2ThqRTEkW47pwhi1QAT12xT
+HmaDMJ8oGe2fzFdZH0Mm8cNdWhLhW/JnIPHhhbJC9wddmOKI+tSf2Vp3kQkABczn
+QLE8
+-----END CERTIFICATE-----
diff --git
a/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/other.p12
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/other.p12
new file mode 100644
index 000000000000..fcdd1ed6f9eb
Binary files /dev/null and
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/other.p12
differ
diff --git
a/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/server.p12
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/server.p12
new file mode 100644
index 000000000000..c506e934f541
Binary files /dev/null and
b/components/camel-pulsar/src/test/resources/org/apache/camel/component/pulsar/hostname/server.p12
differ
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
b/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
index 189a91f0258a..222378347bfb 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
@@ -188,6 +188,7 @@ public final class SecurityUtils {
"component:nats",
"component:netty",
"component:nettyhttp",
+ "component:pulsar",
"component:smpp",
"component:smpps"));
owners.put("httpshostnameverificationenabled", Set.of(
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index d09cb3e5af41..289639742bc3 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -10043,3 +10043,18 @@ the cluster announces (the `connect_urls` in the
`INFO` of the servers, set with
Use certificates that match the hosts, or set the new `hostnameVerification`
option to `false` to keep the previous
behaviour. An `opentls://` server address still trusts
any certificate and is not checked.
+
+=== camel-pulsar - the host name of the broker is verified with pulsar+ssl
+
+When the endpoint creates its own Pulsar client, a `pulsar+ssl://` connection
now checks that the certificate of the
+broker matches the host it connects to, with the same rules as an HTTPS
client. Before, the client kept the default of
+the Pulsar client, which accepts any certificate trusted by the trust store,
whatever host the certificate was issued
+for.
+
+A connection to a host name or an IP address that the certificate does not
list now fails the TLS handshake; this also
+applies to the brokers that a lookup returns (their advertised listeners). Use
certificates that match the hosts, or set
+the new `hostnameVerification` option to `false` to keep the previous
behaviour. A `pulsarClient` that is given to the
+component or the endpoint is used as it is.
+
+The new `tlsTrustCertsFilePath` option sets a PEM file with the certificates
of the certificate authorities to trust,
+for a broker whose certificate is not signed by an authority that the JVM
trusts.
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PulsarComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PulsarComponentBuilderFactory.java
index dd9f03ef4a6b..dc0a540eaa1b 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PulsarComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PulsarComponentBuilderFactory.java
@@ -979,6 +979,44 @@ public interface PulsarComponentBuilderFactory {
doSetProperty("pulsarClient", pulsarClient);
return this;
}
+
+
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarComponentBuilder hostnameVerification(boolean
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+
+ /**
+ * The path of a PEM file with the certificates of the certificate
+ * authorities to trust, for a broker on pulsar+ssl:// whose
certificate
+ * is not signed by an authority that the JVM trusts. Not used when a
+ * pulsarClient is given.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param tlsTrustCertsFilePath the value to set
+ * @return the dsl builder
+ */
+ default PulsarComponentBuilder tlsTrustCertsFilePath(java.lang.String
tlsTrustCertsFilePath) {
+ doSetProperty("tlsTrustCertsFilePath", tlsTrustCertsFilePath);
+ return this;
+ }
}
class PulsarComponentBuilderImpl
@@ -1051,6 +1089,8 @@ public interface PulsarComponentBuilderFactory {
case "autoConfiguration": ((PulsarComponent)
component).setAutoConfiguration((org.apache.camel.component.pulsar.utils.AutoConfiguration)
value); return true;
case "autowiredEnabled": ((PulsarComponent)
component).setAutowiredEnabled((boolean) value); return true;
case "pulsarClient": ((PulsarComponent)
component).setPulsarClient((org.apache.pulsar.client.api.PulsarClient) value);
return true;
+ case "hostnameVerification":
getOrCreateConfiguration((PulsarComponent)
component).setHostnameVerification((boolean) value); return true;
+ case "tlsTrustCertsFilePath":
getOrCreateConfiguration((PulsarComponent)
component).setTlsTrustCertsFilePath((java.lang.String) value); return true;
default: return false;
}
}
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
index 367b129d7447..f1adf0899fcb 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
@@ -801,6 +801,59 @@ public interface PulsarEndpointBuilderFactory {
doSetProperty("topicsPattern", topicsPattern);
return this;
}
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointConsumerBuilder hostnameVerification(boolean
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointConsumerBuilder hostnameVerification(String
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * The path of a PEM file with the certificates of the certificate
+ * authorities to trust, for a broker on pulsar+ssl:// whose
certificate
+ * is not signed by an authority that the JVM trusts. Not used when a
+ * pulsarClient is given.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param tlsTrustCertsFilePath the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointConsumerBuilder tlsTrustCertsFilePath(String
tlsTrustCertsFilePath) {
+ doSetProperty("tlsTrustCertsFilePath", tlsTrustCertsFilePath);
+ return this;
+ }
}
/**
@@ -1434,6 +1487,59 @@ public interface PulsarEndpointBuilderFactory {
doSetProperty("sendTimeoutMs", sendTimeoutMs);
return this;
}
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointProducerBuilder hostnameVerification(boolean
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointProducerBuilder hostnameVerification(String
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * The path of a PEM file with the certificates of the certificate
+ * authorities to trust, for a broker on pulsar+ssl:// whose
certificate
+ * is not signed by an authority that the JVM trusts. Not used when a
+ * pulsarClient is given.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param tlsTrustCertsFilePath the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointProducerBuilder tlsTrustCertsFilePath(String
tlsTrustCertsFilePath) {
+ doSetProperty("tlsTrustCertsFilePath", tlsTrustCertsFilePath);
+ return this;
+ }
}
/**
@@ -1591,6 +1697,59 @@ public interface PulsarEndpointBuilderFactory {
doSetProperty("serviceUrl", serviceUrl);
return this;
}
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointBuilder hostnameVerification(boolean
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * Whether to check that the certificate of the broker matches the host
+ * Camel connects to, with pulsar+ssl://. When disabled, any
certificate
+ * trusted by the client is accepted, whatever host it was issued for.
+ * Not used when a pulsarClient is given.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: security
+ *
+ * @param hostnameVerification the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointBuilder hostnameVerification(String
hostnameVerification) {
+ doSetProperty("hostnameVerification", hostnameVerification);
+ return this;
+ }
+ /**
+ * The path of a PEM file with the certificates of the certificate
+ * authorities to trust, for a broker on pulsar+ssl:// whose
certificate
+ * is not signed by an authority that the JVM trusts. Not used when a
+ * pulsarClient is given.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param tlsTrustCertsFilePath the value to set
+ * @return the dsl builder
+ */
+ default PulsarEndpointBuilder tlsTrustCertsFilePath(String
tlsTrustCertsFilePath) {
+ doSetProperty("tlsTrustCertsFilePath", tlsTrustCertsFilePath);
+ return this;
+ }
}
/**