You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/11 03:22:47 UTC

[camel] branch master updated: Improve support for custom SSLHandler CAMEL-14055 (#3243)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d36f0c9  Improve support for custom SSLHandler CAMEL-14055 (#3243)
d36f0c9 is described below

commit d36f0c977e3f817ab37755133885c404b0617a80
Author: Adam <ad...@gmail.com>
AuthorDate: Thu Oct 10 23:22:41 2019 -0400

    Improve support for custom SSLHandler CAMEL-14055 (#3243)
---
 .../camel/component/netty/http/HttpServerInitializerFactory.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerInitializerFactory.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerInitializerFactory.java
index 25b94e7..ad6016e 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerInitializerFactory.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerInitializerFactory.java
@@ -81,10 +81,16 @@ public class HttpServerInitializerFactory extends ServerInitializerFactory {
         // create a new pipeline
         ChannelPipeline pipeline = ch.pipeline();
 
-        SslHandler sslHandler = configureServerSSLOnDemand();
+        ChannelHandler sslHandler = configureServerSSLOnDemand();
         if (sslHandler != null) {
             //TODO must close on SSL exception
             // sslHandler.setCloseOnSSLException(true);
+
+            if (sslHandler instanceof ChannelHandlerFactory) {
+                // use the factory to create a new instance of the channel as it may not be shareable
+                sslHandler = ((ChannelHandlerFactory) sslHandler).newChannelHandler();
+            }
+
             LOG.debug("Server SSL handler configured and added as an interceptor against the ChannelPipeline: {}", sslHandler);
             pipeline.addLast("ssl", sslHandler);
         }