You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/11/03 13:23:09 UTC

[camel] branch main updated: CAMEL-18680 Wrong initialization of KeyStoreParameters causes java.lang.IllegalArgumentException

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

acosentino 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 ad774bf6f0c CAMEL-18680 Wrong initialization of KeyStoreParameters causes java.lang.IllegalArgumentException
ad774bf6f0c is described below

commit ad774bf6f0c61ffcfbe875a1917ef3e056d30237
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Thu Nov 3 13:23:01 2022 +0100

    CAMEL-18680 Wrong initialization of KeyStoreParameters causes java.lang.IllegalArgumentException
---
 .../java/org/apache/camel/component/vertx/common/VertxHelper.java | 8 ++++++++
 .../java/org/apache/camel/support/jsse/SSLContextParameters.java  | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/components/camel-vertx/camel-vertx-common/src/main/java/org/apache/camel/component/vertx/common/VertxHelper.java b/components/camel-vertx/camel-vertx-common/src/main/java/org/apache/camel/component/vertx/common/VertxHelper.java
index edf4e1c85ee..357173d3c72 100644
--- a/components/camel-vertx/camel-vertx-common/src/main/java/org/apache/camel/component/vertx/common/VertxHelper.java
+++ b/components/camel-vertx/camel-vertx-common/src/main/java/org/apache/camel/component/vertx/common/VertxHelper.java
@@ -73,6 +73,10 @@ public final class VertxHelper {
         if (keyManagers == null) {
             return null;
         }
+        keyManagers.setCamelContext(camelContext);
+        if (keyManagers.getKeyStore() != null) {
+            keyManagers.getKeyStore().setCamelContext(camelContext);
+        }
 
         String kmfAlgorithm = camelContext.resolvePropertyPlaceholders(keyManagers.getAlgorithm());
         if (kmfAlgorithm == null) {
@@ -105,6 +109,10 @@ public final class VertxHelper {
         if (trustManagers == null) {
             return null;
         }
+        trustManagers.setCamelContext(camelContext);
+        if (trustManagers.getKeyStore() != null) {
+            trustManagers.getKeyStore().setCamelContext(camelContext);
+        }
 
         TrustManagerFactory tmf = null;
 
diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
index bd8fe249d06..57a52e43d2b 100644
--- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
+++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
@@ -239,9 +239,15 @@ public class SSLContextParameters extends BaseSSLContextParameters {
             setCamelContext(camelContext);
             if (keyManagers != null) {
                 keyManagers.setCamelContext(camelContext);
+                if (keyManagers.getKeyStore() != null) {
+                    keyManagers.getKeyStore().setCamelContext(camelContext);
+                }
             }
             if (trustManagers != null) {
                 trustManagers.setCamelContext(camelContext);
+                if (trustManagers.getKeyStore() != null) {
+                    trustManagers.getKeyStore().setCamelContext(camelContext);
+                }
             }
             if (secureRandom != null) {
                 secureRandom.setCamelContext(camelContext);