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 09931a3ecdd8 CAMEL-27100: camel-cyberark-vault - load the 
certificatePath file as a classpath: or file: resource (#30315)
09931a3ecdd8 is described below

commit 09931a3ecdd8ef87e096d89177c4b342fa85415e
Author: Urmila Unni <[email protected]>
AuthorDate: Wed Nov 18 15:03:52 2026 +0530

    CAMEL-27100: camel-cyberark-vault - load the certificatePath file as a 
classpath: or file: resource (#30315)
    
    Resolve the certificatePath option with ResourceHelper when it has the 
classpath: or file: prefix. A path without a prefix is still read from the file 
system, and other prefixes such as http: are rejected, as the certificates to 
trust should not come from the network.
    
    Move the upgrade guide note into the existing CAMEL-26279 entry, add a 
classpath: example to the component docs, and describe the prefixes on 
camel.vault.cyberark.certificatePath.
    
    Co-authored-by: Claude <[email protected]>
---
 .../camel/catalog/components/cyberark-vault.json   |  4 +--
 .../catalog/docs/cyberark-vault-component.adoc     | 10 +++++++
 .../org/apache/camel/catalog/docs/main.adoc        |  2 +-
 .../main/camel-main-configuration-metadata.json    |  2 +-
 .../component/cyberark/vault/cyberark-vault.json   |  4 +--
 .../src/main/docs/cyberark-vault-component.adoc    | 10 +++++++
 .../cyberark/vault/CyberArkVaultConfiguration.java |  3 +-
 .../cyberark/vault/CyberArkVaultEndpoint.java      |  3 +-
 .../vault/CyberArkVaultPropertiesFunction.java     |  2 +-
 .../cyberark/vault/client/ConjurClientFactory.java | 31 +++++++++++++++++----
 .../cyberark/vault/CyberArkVaultSslTest.java       | 32 ++++++++++++++++++++++
 .../camel/vault/CyberArkVaultConfiguration.java    |  4 ++-
 .../camel-main-configuration-metadata.json         |  2 +-
 core/camel-main/src/main/docs/main.adoc            |  2 +-
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    |  2 ++
 .../dsl/CyberarkVaultComponentBuilderFactory.java  |  5 +++-
 .../dsl/CyberArkVaultEndpointBuilderFactory.java   |  5 +++-
 17 files changed, 104 insertions(+), 19 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cyberark-vault.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cyberark-vault.json
index dd28e595eb65..a7b60ad51826 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cyberark-vault.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cyberark-vault.json
@@ -34,7 +34,7 @@
     "autowiredEnabled": { "index": 7, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching t [...]
     "apiKey": { "index": 8, "kind": "property", "displayName": "Api Key", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The API key for 
authentication with CyberArk Conjur" },
     "authToken": { "index": 9, "kind": "property", "displayName": "Auth 
Token", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Pre-authenticated token 
to use for CyberArk Conjur" },
-    "certificatePath": { "index": 10, "kind": "property", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
+    "certificatePath": { "index": 10, "kind": "property", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
     "password": { "index": 11, "kind": "property", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The password for 
authentication with CyberArk Conjur" },
     "username": { "index": 12, "kind": "property", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The username for 
authentication with CyberArk Conjur" },
     "verifySsl": { "index": 13, "kind": "property", "displayName": "Verify 
Ssl", "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.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Whether to verify the 
SSL [...]
@@ -53,7 +53,7 @@
     "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a produc [...]
     "apiKey": { "index": 7, "kind": "parameter", "displayName": "Api Key", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The API key for 
authentication with CyberArk Conjur" },
     "authToken": { "index": 8, "kind": "parameter", "displayName": "Auth 
Token", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Pre-authenticated token 
to use for CyberArk Conjur" },
-    "certificatePath": { "index": 9, "kind": "parameter", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
+    "certificatePath": { "index": 9, "kind": "parameter", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
     "password": { "index": 10, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The password for 
authentication with CyberArk Conjur" },
     "username": { "index": 11, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The username for 
authentication with CyberArk Conjur" },
     "verifySsl": { "index": 12, "kind": "parameter", "displayName": "Verify 
Ssl", "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.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Whether to verify the SS 
[...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/cyberark-vault-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/cyberark-vault-component.adoc
index eb5a919ed294..bb3afae298e0 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/cyberark-vault-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/cyberark-vault-component.adoc
@@ -589,6 +589,16 @@ JVM:
 camel.vault.cyberark.certificatePath=/path/to/cert.pem
 ----
 
+The file can also be a resource with the `classpath:` or `file:` prefix, for 
example a certificate packaged with the
+application:
+
+[source,properties]
+----
+camel.vault.cyberark.certificatePath=classpath:conjur-ca.pem
+----
+
+Other prefixes, such as `http:`, are not supported, as the certificates to 
trust should not come from the network.
+
 You can disable the verification for testing purposes, which trusts any server 
(not recommended for production):
 
 [source,properties]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
index 44eeb33b61d9..28e524b53652 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
@@ -604,7 +604,7 @@ The camel.vault.cyberark supports 9 options, which are 
listed below.
 | `camel.vault.cyberark.account` | The CyberArk Conjur account name |  | String
 | `camel.vault.cyberark.apiKey` | The API key for authentication |  | String
 | `camel.vault.cyberark.authToken` | Pre-authenticated token to use |  | String
-| `camel.vault.cyberark.certificatePath` | Path to the SSL certificate for 
verification |  | String
+| `camel.vault.cyberark.certificatePath` | Path of a file with the SSL 
certificate to trust when connecting to CyberArk Conjur, in PEM or DER format: 
a path of the file system, or a resource with the file: or classpath: prefix. 
Other prefixes, such as http:, are not supported. |  | String
 | `camel.vault.cyberark.password` | The password for authentication |  | String
 | `camel.vault.cyberark.secrets` | Specify the secret names (or pattern) to 
check for updates. Multiple secrets can be separated by comma. |  | String
 | `camel.vault.cyberark.url` | The CyberArk Conjur instance URL |  | String
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index 86308db947d2..75f0fb4db154 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -582,7 +582,7 @@
     { "name": "camel.vault.cyberark.account", "required": true, "description": 
"The CyberArk Conjur account name", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.apiKey", "required": false, "description": 
"The API key for authentication", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
     { "name": "camel.vault.cyberark.authToken", "required": false, 
"description": "Pre-authenticated token to use", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
-    { "name": "camel.vault.cyberark.certificatePath", "required": false, 
"description": "Path to the SSL certificate for verification", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
+    { "name": "camel.vault.cyberark.certificatePath", "required": false, 
"description": "Path of a file with the SSL certificate to trust when 
connecting to CyberArk Conjur, in PEM or DER format: a path of the file system, 
or a resource with the file: or classpath: prefix. Other prefixes, such as 
http:, are not supported.", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.password", "required": false, 
"description": "The password for authentication", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
     { "name": "camel.vault.cyberark.secrets", "required": false, 
"description": "Specify the secret names (or pattern) to check for updates. 
Multiple secrets can be separated by comma.", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.url", "required": true, "description": 
"The CyberArk Conjur instance URL", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
diff --git 
a/components/camel-cyberark-vault/src/generated/resources/META-INF/org/apache/camel/component/cyberark/vault/cyberark-vault.json
 
b/components/camel-cyberark-vault/src/generated/resources/META-INF/org/apache/camel/component/cyberark/vault/cyberark-vault.json
index dd28e595eb65..a7b60ad51826 100644
--- 
a/components/camel-cyberark-vault/src/generated/resources/META-INF/org/apache/camel/component/cyberark/vault/cyberark-vault.json
+++ 
b/components/camel-cyberark-vault/src/generated/resources/META-INF/org/apache/camel/component/cyberark/vault/cyberark-vault.json
@@ -34,7 +34,7 @@
     "autowiredEnabled": { "index": 7, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching t [...]
     "apiKey": { "index": 8, "kind": "property", "displayName": "Api Key", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The API key for 
authentication with CyberArk Conjur" },
     "authToken": { "index": 9, "kind": "property", "displayName": "Auth 
Token", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Pre-authenticated token 
to use for CyberArk Conjur" },
-    "certificatePath": { "index": 10, "kind": "property", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
+    "certificatePath": { "index": 10, "kind": "property", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
     "password": { "index": 11, "kind": "property", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The password for 
authentication with CyberArk Conjur" },
     "username": { "index": 12, "kind": "property", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The username for 
authentication with CyberArk Conjur" },
     "verifySsl": { "index": 13, "kind": "property", "displayName": "Verify 
Ssl", "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.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Whether to verify the 
SSL [...]
@@ -53,7 +53,7 @@
     "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a produc [...]
     "apiKey": { "index": 7, "kind": "parameter", "displayName": "Api Key", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The API key for 
authentication with CyberArk Conjur" },
     "authToken": { "index": 8, "kind": "parameter", "displayName": "Auth 
Token", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Pre-authenticated token 
to use for CyberArk Conjur" },
-    "certificatePath": { "index": 9, "kind": "parameter", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
+    "certificatePath": { "index": 9, "kind": "parameter", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Path of a file with the 
SSL certificate to trust when connecting to CyberArk Conj [...]
     "password": { "index": 10, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The password for 
authentication with CyberArk Conjur" },
     "username": { "index": 11, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "The username for 
authentication with CyberArk Conjur" },
     "verifySsl": { "index": 12, "kind": "parameter", "displayName": "Verify 
Ssl", "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.cyberark.vault.CyberArkVaultConfiguration", 
"configurationField": "configuration", "description": "Whether to verify the SS 
[...]
diff --git 
a/components/camel-cyberark-vault/src/main/docs/cyberark-vault-component.adoc 
b/components/camel-cyberark-vault/src/main/docs/cyberark-vault-component.adoc
index eb5a919ed294..bb3afae298e0 100644
--- 
a/components/camel-cyberark-vault/src/main/docs/cyberark-vault-component.adoc
+++ 
b/components/camel-cyberark-vault/src/main/docs/cyberark-vault-component.adoc
@@ -589,6 +589,16 @@ JVM:
 camel.vault.cyberark.certificatePath=/path/to/cert.pem
 ----
 
+The file can also be a resource with the `classpath:` or `file:` prefix, for 
example a certificate packaged with the
+application:
+
+[source,properties]
+----
+camel.vault.cyberark.certificatePath=classpath:conjur-ca.pem
+----
+
+Other prefixes, such as `http:`, are not supported, as the certificates to 
trust should not come from the network.
+
 You can disable the verification for testing purposes, which trusts any server 
(not recommended for production):
 
 [source,properties]
diff --git 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultConfiguration.java
 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultConfiguration.java
index 6fd85e961630..dd5a1cea1ee2 100644
--- 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultConfiguration.java
+++ 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultConfiguration.java
@@ -186,7 +186,8 @@ public class CyberArkVaultConfiguration implements 
Cloneable {
     /**
      * Path of a file with the SSL certificate to trust when connecting to 
CyberArk Conjur, for example the certificate
      * of a private CA, in PEM or DER format. The certificates in the file are 
trusted instead of the default trust
-     * store of the JVM. Not used when verifySsl is false.
+     * store of the JVM. A path of the file system, or a resource with the 
file: or classpath: prefix, for example
+     * classpath:conjur-ca.pem. Other prefixes, such as http:, are not 
supported. Not used when verifySsl is false.
      */
     public void setCertificatePath(String certificatePath) {
         this.certificatePath = certificatePath;
diff --git 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultEndpoint.java
 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultEndpoint.java
index c17e97c78165..7d024173d70e 100644
--- 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultEndpoint.java
+++ 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultEndpoint.java
@@ -98,7 +98,8 @@ public class CyberArkVaultEndpoint extends DefaultEndpoint 
implements EndpointSe
             String username = configuration.getUsername();
             String password = configuration.getPassword();
             SSLContext sslContext
-                    = 
ConjurClientFactory.createSslContext(configuration.isVerifySsl(), 
configuration.getCertificatePath());
+                    = ConjurClientFactory.createSslContext(getCamelContext(), 
configuration.isVerifySsl(),
+                            configuration.getCertificatePath());
 
             if (ObjectHelper.isNotEmpty(authToken)) {
                 conjurClient = ConjurClientFactory.createWithToken(url, 
account, authToken, sslContext);
diff --git 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultPropertiesFunction.java
 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultPropertiesFunction.java
index 98abe08b7b38..6c608f4c8c09 100644
--- 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultPropertiesFunction.java
+++ 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/CyberArkVaultPropertiesFunction.java
@@ -131,7 +131,7 @@ public class CyberArkVaultPropertiesFunction extends 
ServiceSupport implements P
         if (ObjectHelper.isNotEmpty(url) && ObjectHelper.isNotEmpty(account)) {
             // the SSL settings are only in the vault configuration 
(camel.vault.cyberark.verifySsl and certificatePath)
             CyberArkVaultConfiguration sslConfiguration = 
getCamelContext().getVaultConfiguration().cyberark();
-            SSLContext sslContext = 
ConjurClientFactory.createSslContext(sslConfiguration.isVerifySsl(),
+            SSLContext sslContext = 
ConjurClientFactory.createSslContext(getCamelContext(), 
sslConfiguration.isVerifySsl(),
                     sslConfiguration.getCertificatePath());
 
             // Create Conjur client based on authentication method
diff --git 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/client/ConjurClientFactory.java
 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/client/ConjurClientFactory.java
index 2eff03439576..6e823b54982f 100644
--- 
a/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/client/ConjurClientFactory.java
+++ 
b/components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/client/ConjurClientFactory.java
@@ -35,7 +35,9 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509ExtendedTrustManager;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.component.cyberark.vault.client.impl.ConjurClientImpl;
+import org.apache.camel.support.ResourceHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -133,16 +135,17 @@ public final class ConjurClientFactory {
     /**
      * Create the SSL context for the HTTPS connections to Conjur, from the 
verifySsl and certificatePath options.
      *
+     * @param  camelContext             the Camel context, to load a 
classpath: resource
      * @param  verifySsl                whether to verify the certificate and 
the host name of the server. When false,
      *                                  any server is trusted and the 
certificate path is not used.
-     * @param  certificatePath          the path of a file with the 
certificates (PEM or DER) to trust instead of the
-     *                                  default trust store of the JVM, for 
example the certificate of a private CA, or
-     *                                  null
+     * @param  certificatePath          the file with the certificates (PEM or 
DER) to trust instead of the default
+     *                                  trust store of the JVM, for example 
the certificate of a private CA, or null. A
+     *                                  path of the file system, or a resource 
with the file: or classpath: prefix.
      * @return                          the SSL context, or null to use the 
default SSL context of the JVM
      * @throws IOException              if the certificate file cannot be read
      * @throws GeneralSecurityException if the file has no certificate, or the 
SSL context cannot be created
      */
-    public static SSLContext createSslContext(boolean verifySsl, String 
certificatePath)
+    public static SSLContext createSslContext(CamelContext camelContext, 
boolean verifySsl, String certificatePath)
             throws IOException, GeneralSecurityException {
         if (!verifySsl) {
             LOG.warn("SSL verification is disabled (verifySsl=false): the 
certificate and the host name of the"
@@ -156,7 +159,7 @@ public final class ConjurClientFactory {
         }
 
         Collection<? extends Certificate> certificates;
-        try (InputStream in = Files.newInputStream(Path.of(certificatePath))) {
+        try (InputStream in = openCertificate(camelContext, certificatePath)) {
             certificates = 
CertificateFactory.getInstance("X.509").generateCertificates(in);
         }
         if (certificates.isEmpty()) {
@@ -175,6 +178,24 @@ public final class ConjurClientFactory {
         return sslContext;
     }
 
+    /**
+     * Opens the file of the certificatePath option: a classpath: or file: 
resource, or a path of the file system when
+     * there is no prefix. Other prefixes, such as http:, are rejected, as the 
certificates to trust should not come
+     * from the network.
+     */
+    private static InputStream openCertificate(CamelContext camelContext, 
String certificatePath) throws IOException {
+        if (certificatePath.startsWith("classpath:") || 
certificatePath.startsWith("file:")) {
+            return 
ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, 
certificatePath);
+        }
+        // a prefix has at least two letters, so a Windows drive such as C: is 
a path of the file system
+        if (certificatePath.matches("[a-zA-Z][a-zA-Z0-9+.-]+:.*")) {
+            throw new IllegalArgumentException(
+                    "The certificatePath option only supports the classpath: 
and file: prefixes, or a path of the file"
+                                               + " system: " + 
certificatePath);
+        }
+        return Files.newInputStream(Path.of(certificatePath));
+    }
+
     /**
      * Trusts any server without checking its certificate or its host name. 
Only used when verifySsl is false.
      */
diff --git 
a/components/camel-cyberark-vault/src/test/java/org/apache/camel/component/cyberark/vault/CyberArkVaultSslTest.java
 
b/components/camel-cyberark-vault/src/test/java/org/apache/camel/component/cyberark/vault/CyberArkVaultSslTest.java
index df48ac3dcaf8..ec3fa6b9883f 100644
--- 
a/components/camel-cyberark-vault/src/test/java/org/apache/camel/component/cyberark/vault/CyberArkVaultSslTest.java
+++ 
b/components/camel-cyberark-vault/src/test/java/org/apache/camel/component/cyberark/vault/CyberArkVaultSslTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.cyberark.vault;
 
+import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.InetAddress;
@@ -144,6 +145,37 @@ class CyberArkVaultSslTest extends CamelTestSupport {
         assertInstanceOf(NoSuchFileException.class, e.getCause());
     }
 
+    @Test
+    void missingCertificateOnTheClasspathFailsAtStart() throws Exception {
+        Endpoint endpoint = 
context.getComponent("cyberark-vault").createEndpoint(
+                
"cyberark-vault:secret?secretId=db/password&url=https://localhost:1&account=myaccount&authToken=my-token";
+                                                                               
   + "&certificatePath=classpath:missing.pem");
+
+        RuntimeCamelException e = assertThrows(RuntimeCamelException.class, 
endpoint::start);
+        assertInstanceOf(FileNotFoundException.class, e.getCause());
+    }
+
+    @Test
+    void certificatePathOnTheClasspathTrustsTheServer() {
+        assertEquals("secret-value",
+                getSecret("localhost", "&certificatePath=classpath:" + 
SSL_RESOURCES.substring(1) + "conjur-server.pem"));
+    }
+
+    @Test
+    void certificatePathWithTheFilePrefixTrustsTheServer() {
+        assertEquals("secret-value", getSecret("localhost", 
"&certificatePath=RAW(file:" + certificatePath + ")"));
+    }
+
+    @Test
+    void certificatePathWithAnotherPrefixFailsAtStart() throws Exception {
+        Endpoint endpoint = 
context.getComponent("cyberark-vault").createEndpoint(
+                
"cyberark-vault:secret?secretId=db/password&url=https://localhost:1&account=myaccount&authToken=my-token";
+                                                                               
   + "&certificatePath=RAW(http://localhost/conjur.pem)");
+
+        IllegalArgumentException e = 
assertThrows(IllegalArgumentException.class, endpoint::start);
+        assertTrue(e.getMessage().contains("classpath: and file:"), 
e.getMessage());
+    }
+
     @Test
     void propertiesFunctionUsesTheCertificatePathOfTheVaultConfiguration() 
throws Exception {
         var vault = context.getVaultConfiguration().cyberark();
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
 
b/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
index 37f5e66f1403..9f0c08c11101 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
@@ -127,7 +127,9 @@ public class CyberArkVaultConfiguration extends 
VaultConfiguration {
     }
 
     /**
-     * Path to the SSL certificate for verification
+     * Path of a file with the SSL certificate to trust when connecting to 
CyberArk Conjur, in PEM or DER format: a path
+     * of the file system, or a resource with the file: or classpath: prefix. 
Other prefixes, such as http:, are not
+     * supported.
      */
     public void setCertificatePath(@Nullable String certificatePath) {
         this.certificatePath = certificatePath;
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index 86308db947d2..75f0fb4db154 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -582,7 +582,7 @@
     { "name": "camel.vault.cyberark.account", "required": true, "description": 
"The CyberArk Conjur account name", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.apiKey", "required": false, "description": 
"The API key for authentication", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
     { "name": "camel.vault.cyberark.authToken", "required": false, 
"description": "Pre-authenticated token to use", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
-    { "name": "camel.vault.cyberark.certificatePath", "required": false, 
"description": "Path to the SSL certificate for verification", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
+    { "name": "camel.vault.cyberark.certificatePath", "required": false, 
"description": "Path of a file with the SSL certificate to trust when 
connecting to CyberArk Conjur, in PEM or DER format: a path of the file system, 
or a resource with the file: or classpath: prefix. Other prefixes, such as 
http:, are not supported.", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.password", "required": false, 
"description": "The password for authentication", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": true, "security": "secret" },
     { "name": "camel.vault.cyberark.secrets", "required": false, 
"description": "Specify the secret names (or pattern) to check for updates. 
Multiple secrets can be separated by comma.", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.vault.cyberark.url", "required": true, "description": 
"The CyberArk Conjur instance URL", "sourceType": 
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string", 
"javaType": "java.lang.String", "secret": false },
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index 44eeb33b61d9..28e524b53652 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -604,7 +604,7 @@ The camel.vault.cyberark supports 9 options, which are 
listed below.
 | `camel.vault.cyberark.account` | The CyberArk Conjur account name |  | String
 | `camel.vault.cyberark.apiKey` | The API key for authentication |  | String
 | `camel.vault.cyberark.authToken` | Pre-authenticated token to use |  | String
-| `camel.vault.cyberark.certificatePath` | Path to the SSL certificate for 
verification |  | String
+| `camel.vault.cyberark.certificatePath` | Path of a file with the SSL 
certificate to trust when connecting to CyberArk Conjur, in PEM or DER format: 
a path of the file system, or a resource with the file: or classpath: prefix. 
Other prefixes, such as http:, are not supported. |  | String
 | `camel.vault.cyberark.password` | The password for authentication |  | String
 | `camel.vault.cyberark.secrets` | Specify the secret names (or pattern) to 
check for updates. Multiple secrets can be separated by comma. |  | String
 | `camel.vault.cyberark.url` | The CyberArk Conjur instance URL |  | String
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 65ad6612138c..113492f57796 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
@@ -2706,6 +2706,8 @@ trust store of the JVM was always used.
 * With `certificatePath`, the certificates in that file (PEM or DER) are 
trusted instead of the default trust store of
   the JVM, and the endpoint or the function fails to start when the file 
cannot be read. Remove `certificatePath` to
   keep the default trust store of the JVM.
+  The file is a path of the file system, or a resource with the `classpath:` 
or `file:` prefix. Other prefixes, such
+  as `http:`, are rejected.
 * With `verifySsl=false`, neither the certificate nor the host name of the 
server is checked. The option is now marked
   as an insecure SSL setting, so the security policy reports 
`camel.component.cyberark-vault.verifySsl=false`, which
   fails the startup with `camel.main.profile=prod`. Set `certificatePath` to 
the certificate of the server or of its
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/CyberarkVaultComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/CyberarkVaultComponentBuilderFactory.java
index 7f37a0374666..1a9921609e4f 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/CyberarkVaultComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/CyberarkVaultComponentBuilderFactory.java
@@ -226,7 +226,10 @@ public interface CyberarkVaultComponentBuilderFactory {
          * Path of a file with the SSL certificate to trust when connecting to
          * CyberArk Conjur, for example the certificate of a private CA, in PEM
          * or DER format. The certificates in the file are trusted instead of
-         * the default trust store of the JVM. Not used when verifySsl is 
false.
+         * the default trust store of the JVM. A path of the file system, or a
+         * resource with the file: or classpath: prefix, for example
+         * classpath:conjur-ca.pem. Other prefixes, such as http:, are not
+         * supported. Not used when verifySsl is false.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CyberArkVaultEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CyberArkVaultEndpointBuilderFactory.java
index ccadf867b0b8..57a38cc31ee2 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CyberArkVaultEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CyberArkVaultEndpointBuilderFactory.java
@@ -182,7 +182,10 @@ public interface CyberArkVaultEndpointBuilderFactory {
          * Path of a file with the SSL certificate to trust when connecting to
          * CyberArk Conjur, for example the certificate of a private CA, in PEM
          * or DER format. The certificates in the file are trusted instead of
-         * the default trust store of the JVM. Not used when verifySsl is 
false.
+         * the default trust store of the JVM. A path of the file system, or a
+         * resource with the file: or classpath: prefix, for example
+         * classpath:conjur-ca.pem. Other prefixes, such as http:, are not
+         * supported. Not used when verifySsl is false.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 

Reply via email to