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

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit bdbd8ed3b9821291436480d9f14ce022b759e439
Author: Zoran Regvart <zregv...@apache.org>
AuthorDate: Fri May 22 12:54:18 2020 +0200

    CAMEL-15100: Use default SSLContext when keysto...
    
    ...re/trustore is not provided
    
    If there is no custom keystore or trustore configured, as file or as
    resource reference, this configures the SSLContext with the JVM
    defaults.
---
 .../camel/component/netty/http/HttpClientInitializerFactory.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
index fd1bdbd..454da92 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
@@ -163,7 +163,7 @@ public class HttpClientInitializerFactory extends 
ClientInitializerFactory {
                         "file:" + configuration.getKeyStoreFile().getPath(),
                         "file:" + configuration.getTrustStoreFile().getPath(),
                         pw);
-            } else {
+            } else if (configuration.getKeyStoreResource() != null || 
configuration.getTrustStoreResource() != null) {
                 sslEngineFactory = new SSLEngineFactory();
                 answer = 
sslEngineFactory.createSSLContext(producer.getContext(),
                         configuration.getKeyStoreFormat(),
@@ -171,6 +171,8 @@ public class HttpClientInitializerFactory extends 
ClientInitializerFactory {
                         configuration.getKeyStoreResource(),
                         configuration.getTrustStoreResource(),
                         pw);
+            } else {
+                answer = SSLContext.getDefault();
             }
         }
 

Reply via email to