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

nfilotto pushed a commit to branch CAMEL-19840/warn-no-keystore
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8c18e0a1226663f708403a13a93e79b31c62fc5a
Author: Nicolas Filotto <nfilo...@talend.com>
AuthorDate: Wed Sep 6 10:18:20 2023 +0200

    CAMEL-19840: camel-core-api - Add a warning when the key store file could 
not be found
---
 .../java/org/apache/camel/support/jsse/KeyStoreParameters.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java
 
b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java
index 971ac55183e..b6ff5c36f48 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java
@@ -190,7 +190,13 @@ public class KeyStoreParameters extends JsseParameters {
             ks.load(null, ksPassword);
         } else {
             InputStream is = 
this.resolveResource(this.parsePropertyValue(this.resource));
-            ks.load(is, ksPassword);
+            if (is == null) {
+                LOG.warn("No keystore could be found at {}.", this.resource);
+            } else {
+                try (is) {
+                    ks.load(is, ksPassword);
+                }
+            }
         }
 
         if (LOG.isDebugEnabled()) {

Reply via email to