This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.22.x by this push:
new 3fef95cddd38 [backport camel-4.22.x] CAMEL-27207: CAMEL-27207,
CAMEL-27196: camel-pulsar - check the host name of the broker with pulsar+ssl,
and add tlsTrustCertsFilePath (#30413)
3fef95cddd38 is described below
commit 3fef95cddd38523b10a54e68c1927e3d4a49f35c
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 14:09:01 2026 +0100
[backport camel-4.22.x] CAMEL-27207: CAMEL-27207, CAMEL-27196: camel-pulsar
- check the host name of the broker with pulsar+ssl, and add
tlsTrustCertsFilePath (#30413)
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]>
(cherry picked from commit a7b8d8d66b2d180ffbc3763e8149605840d87111)
---
.../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
.../dsl/PulsarComponentBuilderFactory.java | 40 ++++++
.../endpoint/dsl/PulsarEndpointBuilderFactory.java | 159 +++++++++++++++++++++
13 files changed, 456 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 baa4889225c1..d84db93b7e4d 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
@@ -73,7 +73,9 @@
"sendTimeoutMs": { "index": 46, "kind": "property", "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":
"configuration", "description": "Send timeout in milliseconds" },
"autoConfiguration": { "index": 47, "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": 48, "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": 49, "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": 49, "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": 50, "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": 51, "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, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The properties attached to the message.",
"constantName":
"org.apache.camel.component.pulsar.utils.message.PulsarMessageHeaders#PROPERTIES"
},
@@ -145,6 +147,8 @@
"messageRoutingMode": { "index": 47, "kind": "parameter", "displayName":
"Message Routing Mode", "group": "producer", "label": "producer", "required":
false, "type": "enum", "javaType":
"org.apache.pulsar.client.api.MessageRoutingMode", "enum": [ "SinglePartition",
"RoundRobinPartition", "CustomPartition" ], "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "RoundRobinPartition",
"configurationClass": "org.apache.camel.component.pulsar.PulsarConfiguration",
"c [...]
"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" },
- "lazyStartProducer": { "index": 50, "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": 50, "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": 51, "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": 52, "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 [...]
}
}
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 c3236ad18ba0..fea2637a1c7f 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
@@ -77,6 +77,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":
@@ -127,6 +129,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;
@@ -188,6 +192,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":
@@ -238,6 +244,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;
@@ -295,6 +303,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":
@@ -345,6 +355,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 ebb850773579..4476762e9c2e 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
@@ -69,6 +69,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":
@@ -115,6 +117,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;
@@ -170,6 +174,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":
@@ -216,6 +222,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;
@@ -272,6 +280,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":
@@ -318,6 +328,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 a2dcb84e25f0..210dabd36400 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<>(51);
+ Set<String> props = new HashSet<>(53);
props.add("ackGroupTimeMillis");
props.add("ackTimeoutMillis");
props.add("ackTimeoutRedeliveryBackoff");
@@ -48,6 +48,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");
@@ -74,6 +75,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 baa4889225c1..d84db93b7e4d 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
@@ -73,7 +73,9 @@
"sendTimeoutMs": { "index": 46, "kind": "property", "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":
"configuration", "description": "Send timeout in milliseconds" },
"autoConfiguration": { "index": 47, "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": 48, "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": 49, "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": 49, "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": 50, "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": 51, "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, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The properties attached to the message.",
"constantName":
"org.apache.camel.component.pulsar.utils.message.PulsarMessageHeaders#PROPERTIES"
},
@@ -145,6 +147,8 @@
"messageRoutingMode": { "index": 47, "kind": "parameter", "displayName":
"Message Routing Mode", "group": "producer", "label": "producer", "required":
false, "type": "enum", "javaType":
"org.apache.pulsar.client.api.MessageRoutingMode", "enum": [ "SinglePartition",
"RoundRobinPartition", "CustomPartition" ], "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "RoundRobinPartition",
"configurationClass": "org.apache.camel.component.pulsar.PulsarConfiguration",
"c [...]
"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" },
- "lazyStartProducer": { "index": 50, "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": 50, "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": 51, "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": 52, "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 [...]
}
}
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 0930f127e37c..2acec85487e2 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
@@ -44,6 +44,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")
@@ -641,6 +645,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 fd6de025b5ba..1b3d540648bf 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
@@ -172,6 +172,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/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 7c019758db60..0fd8df31754a 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
@@ -953,6 +953,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 pulsarssl://. 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 pulsarssl:// 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
@@ -1024,6 +1062,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 3a73d95d10c0..2f9de0e81786 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 pulsarssl://. 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 pulsarssl://. 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 pulsarssl:// 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;
+ }
}
/**
@@ -1430,6 +1483,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 pulsarssl://. 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 pulsarssl://. 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 pulsarssl:// 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;
+ }
}
/**
@@ -1543,6 +1649,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 pulsarssl://. 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 pulsarssl://. 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 pulsarssl:// 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;
+ }
}
/**