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 2021/03/08 14:17:17 UTC

[camel] branch master updated (a5f6bf1 -> 9b596d7)

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

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


    from a5f6bf1  Regen for commit f12572cb2dd95e402ddde56bcd14313b843c0e0e
     new cc836cb  CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x
     new 3b02bcd  CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x
     new 9b596d7  CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/catalog/components/netty-http.json       |  2 +
 .../org/apache/camel/catalog/components/netty.json |  2 +
 .../apache/camel/catalog/docs/netty-component.adoc |  6 +-
 .../camel/catalog/docs/netty-http-component.adoc   |  6 +-
 .../http/NettyHttpConfigurationConfigurer.java     |  6 ++
 .../netty/http/NettyHttpEndpointUriFactory.java    |  3 +-
 .../camel/component/netty/http/netty-http.json     |  2 +
 .../src/main/docs/netty-http-component.adoc        |  6 +-
 .../component/netty/NettyComponentConfigurer.java  |  6 ++
 .../netty/NettyConfigurationConfigurer.java        |  6 ++
 .../component/netty/NettyEndpointConfigurer.java   |  6 ++
 .../component/netty/NettyEndpointUriFactory.java   |  3 +-
 .../org/apache/camel/component/netty/netty.json    |  2 +
 .../camel-netty/src/main/docs/netty-component.adoc |  6 +-
 .../netty/DefaultClientInitializerFactory.java     |  6 ++
 .../netty/DefaultServerInitializerFactory.java     |  6 ++
 .../camel/component/netty/NettyConfiguration.java  | 13 +++
 .../apache/camel/component/netty/NettySSLTest.java |  2 +-
 .../dsl/NettyComponentBuilderFactory.java          | 17 ++++
 .../dsl/NettyHttpComponentBuilderFactory.java      | 17 ++++
 .../endpoint/dsl/NettyEndpointBuilderFactory.java  | 99 ++++++++++++++++++++++
 .../dsl/NettyHttpEndpointBuilderFactory.java       | 99 ++++++++++++++++++++++
 .../modules/ROOT/pages/netty-component.adoc        |  6 +-
 .../modules/ROOT/pages/netty-http-component.adoc   |  6 +-
 24 files changed, 318 insertions(+), 15 deletions(-)


[camel] 02/03: CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3b02bcd6b910951ce11d86c0db27dbc0d77e35c6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 8 14:25:46 2021 +0100

    CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x
---
 .../apache/camel/catalog/docs/netty-component.adoc |  6 +-
 .../component/netty/NettyComponentConfigurer.java  |  6 ++
 .../netty/NettyConfigurationConfigurer.java        |  6 ++
 .../component/netty/NettyEndpointConfigurer.java   |  6 ++
 .../component/netty/NettyEndpointUriFactory.java   |  3 +-
 .../org/apache/camel/component/netty/netty.json    |  2 +
 .../camel-netty/src/main/docs/netty-component.adoc |  6 +-
 .../camel/component/netty/NettyConfiguration.java  |  6 +-
 .../component/netty/ssl/SSLEngineFactory.java      |  1 -
 .../apache/camel/component/netty/NettySSLTest.java |  2 +-
 .../dsl/NettyComponentBuilderFactory.java          | 17 ++++
 .../endpoint/dsl/NettyEndpointBuilderFactory.java  | 99 ++++++++++++++++++++++
 .../modules/ROOT/pages/netty-component.adoc        |  6 +-
 13 files changed, 154 insertions(+), 12 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-component.adoc
index f1c80ae..833284a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-component.adoc
@@ -59,7 +59,7 @@ You can append query options to the URI in the following format,
 == Options
 
 // component options: START
-The Netty component supports 72 options, which are listed below.
+The Netty component supports 73 options, which are listed below.
 
 
 
@@ -68,6 +68,7 @@ The Netty component supports 72 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -163,13 +164,14 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (70 parameters):
+=== Query Parameters (71 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
diff --git a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyComponentConfigurer.java b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyComponentConfigurer.java
index a045076..a8a7416 100644
--- a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyComponentConfigurer.java
+++ b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyComponentConfigurer.java
@@ -68,6 +68,8 @@ public class NettyComponentConfigurer extends PropertyConfigurerSupport implemen
         case "encoding": getOrCreateConfiguration(target).setEncoding(property(camelContext, java.lang.String.class, value)); return true;
         case "executorservice":
         case "executorService": target.setExecutorService(property(camelContext, io.netty.util.concurrent.EventExecutorGroup.class, value)); return true;
+        case "hostnameverification":
+        case "hostnameVerification": getOrCreateConfiguration(target).setHostnameVerification(property(camelContext, boolean.class, value)); return true;
         case "keepalive":
         case "keepAlive": getOrCreateConfiguration(target).setKeepAlive(property(camelContext, boolean.class, value)); return true;
         case "keystorefile":
@@ -205,6 +207,8 @@ public class NettyComponentConfigurer extends PropertyConfigurerSupport implemen
         case "encoding": return java.lang.String.class;
         case "executorservice":
         case "executorService": return io.netty.util.concurrent.EventExecutorGroup.class;
+        case "hostnameverification":
+        case "hostnameVerification": return boolean.class;
         case "keepalive":
         case "keepAlive": return boolean.class;
         case "keystorefile":
@@ -343,6 +347,8 @@ public class NettyComponentConfigurer extends PropertyConfigurerSupport implemen
         case "encoding": return getOrCreateConfiguration(target).getEncoding();
         case "executorservice":
         case "executorService": return target.getExecutorService();
+        case "hostnameverification":
+        case "hostnameVerification": return getOrCreateConfiguration(target).isHostnameVerification();
         case "keepalive":
         case "keepAlive": return getOrCreateConfiguration(target).isKeepAlive();
         case "keystorefile":
diff --git a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyConfigurationConfigurer.java b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyConfigurationConfigurer.java
index b2aa719..86f45c0 100644
--- a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyConfigurationConfigurer.java
+++ b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyConfigurationConfigurer.java
@@ -65,6 +65,8 @@ public class NettyConfigurationConfigurer extends org.apache.camel.support.compo
         case "Encoding": target.setEncoding(property(camelContext, java.lang.String.class, value)); return true;
         case "host":
         case "Host": target.setHost(property(camelContext, java.lang.String.class, value)); return true;
+        case "hostnameverification":
+        case "HostnameVerification": target.setHostnameVerification(property(camelContext, boolean.class, value)); return true;
         case "keepalive":
         case "KeepAlive": target.setKeepAlive(property(camelContext, boolean.class, value)); return true;
         case "keystorefile":
@@ -212,6 +214,8 @@ public class NettyConfigurationConfigurer extends org.apache.camel.support.compo
         case "Encoding": return java.lang.String.class;
         case "host":
         case "Host": return java.lang.String.class;
+        case "hostnameverification":
+        case "HostnameVerification": return boolean.class;
         case "keepalive":
         case "KeepAlive": return boolean.class;
         case "keystorefile":
@@ -360,6 +364,8 @@ public class NettyConfigurationConfigurer extends org.apache.camel.support.compo
         case "Encoding": return target.getEncoding();
         case "host":
         case "Host": return target.getHost();
+        case "hostnameverification":
+        case "HostnameVerification": return target.isHostnameVerification();
         case "keepalive":
         case "KeepAlive": return target.isKeepAlive();
         case "keystorefile":
diff --git a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointConfigurer.java b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointConfigurer.java
index 2da99df..35808d2 100644
--- a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointConfigurer.java
+++ b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointConfigurer.java
@@ -60,6 +60,8 @@ public class NettyEndpointConfigurer extends PropertyConfigurerSupport implement
         case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
         case "exchangepattern":
         case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
+        case "hostnameverification":
+        case "hostnameVerification": target.getConfiguration().setHostnameVerification(property(camelContext, boolean.class, value)); return true;
         case "keepalive":
         case "keepAlive": target.getConfiguration().setKeepAlive(property(camelContext, boolean.class, value)); return true;
         case "keystorefile":
@@ -193,6 +195,8 @@ public class NettyEndpointConfigurer extends PropertyConfigurerSupport implement
         case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
         case "exchangepattern":
         case "exchangePattern": return org.apache.camel.ExchangePattern.class;
+        case "hostnameverification":
+        case "hostnameVerification": return boolean.class;
         case "keepalive":
         case "keepAlive": return boolean.class;
         case "keystorefile":
@@ -327,6 +331,8 @@ public class NettyEndpointConfigurer extends PropertyConfigurerSupport implement
         case "exceptionHandler": return target.getExceptionHandler();
         case "exchangepattern":
         case "exchangePattern": return target.getExchangePattern();
+        case "hostnameverification":
+        case "hostnameVerification": return target.getConfiguration().isHostnameVerification();
         case "keepalive":
         case "keepAlive": return target.getConfiguration().isKeepAlive();
         case "keystorefile":
diff --git a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointUriFactory.java b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointUriFactory.java
index 42f7857..6c0d733 100644
--- a/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointUriFactory.java
+++ b/components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyEndpointUriFactory.java
@@ -20,11 +20,12 @@ public class NettyEndpointUriFactory extends org.apache.camel.support.component.
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(73);
+        Set<String> props = new HashSet<>(74);
         props.add("usingExecutorService");
         props.add("disconnect");
         props.add("enabledProtocols");
         props.add("synchronous");
+        props.add("hostnameVerification");
         props.add("keyStoreFormat");
         props.add("producerPoolMinIdle");
         props.add("ssl");
diff --git a/components/camel-netty/src/generated/resources/org/apache/camel/component/netty/netty.json b/components/camel-netty/src/generated/resources/org/apache/camel/component/netty/netty.json
index 1c1958d..de5f869 100644
--- a/components/camel-netty/src/generated/resources/org/apache/camel/component/netty/netty.json
+++ b/components/camel-netty/src/generated/resources/org/apache/camel/component/netty/netty.json
@@ -24,6 +24,7 @@
   "componentProperties": {
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.netty.NettyConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the NettyConfiguration as configuration when creating endpoints." },
     "disconnect": { "kind": "property", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "property", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "property", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "property", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "property", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecy [...]
@@ -100,6 +101,7 @@
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "The hostname. For the consumer the hostname is localhost or 0.0.0.0. For the producer the hostname is the remote host to conne [...]
     "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": true, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "The host port number" },
     "disconnect": { "kind": "parameter", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "parameter", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "parameter", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "parameter", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "parameter", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifec [...]
diff --git a/components/camel-netty/src/main/docs/netty-component.adoc b/components/camel-netty/src/main/docs/netty-component.adoc
index f1c80ae..833284a 100644
--- a/components/camel-netty/src/main/docs/netty-component.adoc
+++ b/components/camel-netty/src/main/docs/netty-component.adoc
@@ -59,7 +59,7 @@ You can append query options to the URI in the following format,
 == Options
 
 // component options: START
-The Netty component supports 72 options, which are listed below.
+The Netty component supports 73 options, which are listed below.
 
 
 
@@ -68,6 +68,7 @@ The Netty component supports 72 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -163,13 +164,14 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (70 parameters):
+=== Query Parameters (71 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
index e9e9bc9..805e1da 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
@@ -67,8 +67,8 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
     private List<ChannelHandler> encoders = new ArrayList<>();
     @UriParam(label = "codec")
     private List<ChannelHandler> decoders = new ArrayList<>();
-    @UriParam(label = "common", defaultValue = "true")
-    private boolean hostnameVerification = true;
+    @UriParam(label = "common", defaultValue = "false")
+    private boolean hostnameVerification;
     @UriParam
     private boolean disconnect;
     @UriParam(label = "producer,advanced", defaultValue = "true")
@@ -732,7 +732,7 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
      */
     public void setHostnameVerification(boolean hostnameVerification) {
         this.hostnameVerification = hostnameVerification;
-    }    
+    }
 
     private static <T> void addToHandlersList(List<T> configured, List<T> handlers, Class<T> handlerType) {
         if (handlers != null) {
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
index ae99ecf..ef77e79 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
@@ -22,7 +22,6 @@ import java.security.KeyStore;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
-import javax.net.ssl.SSLParameters;
 import javax.net.ssl.TrustManagerFactory;
 
 import org.apache.camel.CamelContext;
diff --git a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettySSLTest.java b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettySSLTest.java
index 8347ddc..0f17dd5 100644
--- a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettySSLTest.java
+++ b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettySSLTest.java
@@ -58,7 +58,7 @@ public class NettySSLTest extends BaseNettyTest {
             public void configure() {
                 // needClientAuth=true so we can get the client certificate
                 // details
-                from("netty:tcp://localhost:{{port}}?sync=true&ssl=true&passphrase=changeit&keyStoreResource=#ksf&trustStoreResource=#tsf&needClientAuth=true")
+                from("netty:tcp://127.0.0.1:{{port}}?sync=true&ssl=true&passphrase=changeit&keyStoreResource=#ksf&trustStoreResource=#tsf&needClientAuth=true")
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
                                 SSLSession session
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
index 78f2b23..5928c55 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
@@ -82,6 +82,22 @@ public interface NettyComponentBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyComponentBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -1329,6 +1345,7 @@ public interface NettyComponentBuilderFactory {
             switch (name) {
             case "configuration": ((NettyComponent) component).setConfiguration((org.apache.camel.component.netty.NettyConfiguration) value); return true;
             case "disconnect": getOrCreateConfiguration((NettyComponent) component).setDisconnect((boolean) value); return true;
+            case "hostnameVerification": getOrCreateConfiguration((NettyComponent) component).setHostnameVerification((boolean) value); return true;
             case "keepAlive": getOrCreateConfiguration((NettyComponent) component).setKeepAlive((boolean) value); return true;
             case "reuseAddress": getOrCreateConfiguration((NettyComponent) component).setReuseAddress((boolean) value); return true;
             case "reuseChannel": getOrCreateConfiguration((NettyComponent) component).setReuseChannel((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
index 6132062..e134819 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
@@ -79,6 +79,39 @@ public interface NettyEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointConsumerBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointConsumerBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -1946,6 +1979,39 @@ public interface NettyEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointProducerBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointProducerBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -3668,6 +3734,39 @@ public interface NettyEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyEndpointBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
diff --git a/docs/components/modules/ROOT/pages/netty-component.adoc b/docs/components/modules/ROOT/pages/netty-component.adoc
index 71bea8f..da604ac 100644
--- a/docs/components/modules/ROOT/pages/netty-component.adoc
+++ b/docs/components/modules/ROOT/pages/netty-component.adoc
@@ -61,7 +61,7 @@ You can append query options to the URI in the following format,
 == Options
 
 // component options: START
-The Netty component supports 72 options, which are listed below.
+The Netty component supports 73 options, which are listed below.
 
 
 
@@ -70,6 +70,7 @@ The Netty component supports 72 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -165,13 +166,14 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (70 parameters):
+=== Query Parameters (71 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]


[camel] 03/03: CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9b596d7a548506a8cfe344835a4df63014c9597e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 8 14:59:44 2021 +0100

    CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x
---
 .../camel/catalog/components/netty-http.json       |  2 +
 .../org/apache/camel/catalog/components/netty.json |  2 +
 .../camel/catalog/docs/netty-http-component.adoc   |  6 +-
 .../http/NettyHttpConfigurationConfigurer.java     |  6 ++
 .../netty/http/NettyHttpEndpointUriFactory.java    |  3 +-
 .../camel/component/netty/http/netty-http.json     |  2 +
 .../src/main/docs/netty-http-component.adoc        |  6 +-
 .../dsl/NettyHttpComponentBuilderFactory.java      | 17 ++++
 .../dsl/NettyHttpEndpointBuilderFactory.java       | 99 ++++++++++++++++++++++
 .../modules/ROOT/pages/netty-http-component.adoc   |  6 +-
 10 files changed, 142 insertions(+), 7 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
index 9844149..54a9273 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
@@ -25,6 +25,7 @@
   "componentProperties": {
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.netty.NettyConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the NettyConfiguration as configuration when creating endpoints." },
     "disconnect": { "kind": "property", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "property", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "property", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "property", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "property", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecy [...]
@@ -106,6 +107,7 @@
     "path": { "kind": "path", "displayName": "Path", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Resource path" },
     "bridgeEndpoint": { "kind": "parameter", "displayName": "Bridge Endpoint", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint [...]
     "disconnect": { "kind": "parameter", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and p [...]
+    "hostnameVerification": { "kind": "parameter", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "parameter", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "parameter", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "parameter", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for  [...]
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
index 1c1958d..de5f869 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
@@ -24,6 +24,7 @@
   "componentProperties": {
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.netty.NettyConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the NettyConfiguration as configuration when creating endpoints." },
     "disconnect": { "kind": "property", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "property", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "property", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "property", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "property", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecy [...]
@@ -100,6 +101,7 @@
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "The hostname. For the consumer the hostname is localhost or 0.0.0.0. For the producer the hostname is the remote host to conne [...]
     "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": true, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "The host port number" },
     "disconnect": { "kind": "parameter", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "parameter", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "parameter", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "parameter", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "parameter", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifec [...]
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-http-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-http-component.adoc
index 8bf47e3..22a8021 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-http-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/netty-http-component.adoc
@@ -97,7 +97,7 @@ related to UDP transport.
 
 
 // component options: START
-The Netty HTTP component supports 75 options, which are listed below.
+The Netty HTTP component supports 76 options, which are listed below.
 
 
 
@@ -106,6 +106,7 @@ The Netty HTTP component supports 75 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -213,7 +214,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (79 parameters):
+=== Query Parameters (80 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -221,6 +222,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | *bridgeEndpoint* (common) | If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExceptionOnFailure to be false to let the producer send all the fault response back. The consumer working in the bridge mode will skip the gzip compression and WWW URL form encoding (by adding the Exchange.SKIP_GZIP_ENCODING and Exchange.SKIP_WWW_FORM_URLENCODED headers to the consumed exchange). | false | boolean
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
diff --git a/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpConfigurationConfigurer.java b/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpConfigurationConfigurer.java
index 9ab13aa..56fd5c8 100644
--- a/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpConfigurationConfigurer.java
+++ b/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpConfigurationConfigurer.java
@@ -73,6 +73,8 @@ public class NettyHttpConfigurationConfigurer extends org.apache.camel.support.c
         case "Encoding": target.setEncoding(property(camelContext, java.lang.String.class, value)); return true;
         case "host":
         case "Host": target.setHost(property(camelContext, java.lang.String.class, value)); return true;
+        case "hostnameverification":
+        case "HostnameVerification": target.setHostnameVerification(property(camelContext, boolean.class, value)); return true;
         case "keepalive":
         case "KeepAlive": target.setKeepAlive(property(camelContext, boolean.class, value)); return true;
         case "keystorefile":
@@ -254,6 +256,8 @@ public class NettyHttpConfigurationConfigurer extends org.apache.camel.support.c
         case "Encoding": return java.lang.String.class;
         case "host":
         case "Host": return java.lang.String.class;
+        case "hostnameverification":
+        case "HostnameVerification": return boolean.class;
         case "keepalive":
         case "KeepAlive": return boolean.class;
         case "keystorefile":
@@ -436,6 +440,8 @@ public class NettyHttpConfigurationConfigurer extends org.apache.camel.support.c
         case "Encoding": return target.getEncoding();
         case "host":
         case "Host": return target.getHost();
+        case "hostnameverification":
+        case "HostnameVerification": return target.isHostnameVerification();
         case "keepalive":
         case "KeepAlive": return target.isKeepAlive();
         case "keystorefile":
diff --git a/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriFactory.java b/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriFactory.java
index adbf07b..395b003 100644
--- a/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriFactory.java
+++ b/components/camel-netty-http/src/generated/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriFactory.java
@@ -20,12 +20,13 @@ public class NettyHttpEndpointUriFactory extends org.apache.camel.support.compon
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(83);
+        Set<String> props = new HashSet<>(84);
         props.add("usingExecutorService");
         props.add("disconnect");
         props.add("enabledProtocols");
         props.add("synchronous");
         props.add("nettySharedHttpServer");
+        props.add("hostnameVerification");
         props.add("keyStoreFormat");
         props.add("producerPoolMinIdle");
         props.add("ssl");
diff --git a/components/camel-netty-http/src/generated/resources/org/apache/camel/component/netty/http/netty-http.json b/components/camel-netty-http/src/generated/resources/org/apache/camel/component/netty/http/netty-http.json
index 9844149..54a9273 100644
--- a/components/camel-netty-http/src/generated/resources/org/apache/camel/component/netty/http/netty-http.json
+++ b/components/camel-netty-http/src/generated/resources/org/apache/camel/component/netty/http/netty-http.json
@@ -25,6 +25,7 @@
   "componentProperties": {
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.netty.NettyConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the NettyConfiguration as configuration when creating endpoints." },
     "disconnect": { "kind": "property", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer." },
+    "hostnameVerification": { "kind": "property", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "property", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "property", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "property", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.NettyConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecy [...]
@@ -106,6 +107,7 @@
     "path": { "kind": "path", "displayName": "Path", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Resource path" },
     "bridgeEndpoint": { "kind": "parameter", "displayName": "Bridge Endpoint", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint [...]
     "disconnect": { "kind": "parameter", "displayName": "Disconnect", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and p [...]
+    "hostnameVerification": { "kind": "parameter", "displayName": "Hostname Verification", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "To enable\/disable hostname verification on SSLEngine" },
     "keepAlive": { "kind": "parameter", "displayName": "Keep Alive", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Setting to ensure socket is not closed due to inactivity" },
     "reuseAddress": { "kind": "parameter", "displayName": "Reuse Address", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "Setting to facilitate socket multiplexing" },
     "reuseChannel": { "kind": "parameter", "displayName": "Reuse Channel", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.netty.http.NettyHttpConfiguration", "configurationField": "configuration", "description": "This option allows producers and consumers (in client mode) to reuse the same Netty Channel for  [...]
diff --git a/components/camel-netty-http/src/main/docs/netty-http-component.adoc b/components/camel-netty-http/src/main/docs/netty-http-component.adoc
index 8bf47e3..22a8021 100644
--- a/components/camel-netty-http/src/main/docs/netty-http-component.adoc
+++ b/components/camel-netty-http/src/main/docs/netty-http-component.adoc
@@ -97,7 +97,7 @@ related to UDP transport.
 
 
 // component options: START
-The Netty HTTP component supports 75 options, which are listed below.
+The Netty HTTP component supports 76 options, which are listed below.
 
 
 
@@ -106,6 +106,7 @@ The Netty HTTP component supports 75 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -213,7 +214,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (79 parameters):
+=== Query Parameters (80 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -221,6 +222,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | *bridgeEndpoint* (common) | If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExceptionOnFailure to be false to let the producer send all the fault response back. The consumer working in the bridge mode will skip the gzip compression and WWW URL form encoding (by adding the Exchange.SKIP_GZIP_ENCODING and Exchange.SKIP_WWW_FORM_URLENCODED headers to the consumed exchange). | false | boolean
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
index c682a08..9ba23e7 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
@@ -84,6 +84,22 @@ public interface NettyHttpComponentBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpComponentBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -1391,6 +1407,7 @@ public interface NettyHttpComponentBuilderFactory {
             switch (name) {
             case "configuration": ((NettyHttpComponent) component).setConfiguration((org.apache.camel.component.netty.NettyConfiguration) value); return true;
             case "disconnect": getOrCreateConfiguration((NettyHttpComponent) component).setDisconnect((boolean) value); return true;
+            case "hostnameVerification": getOrCreateConfiguration((NettyHttpComponent) component).setHostnameVerification((boolean) value); return true;
             case "keepAlive": getOrCreateConfiguration((NettyHttpComponent) component).setKeepAlive((boolean) value); return true;
             case "reuseAddress": getOrCreateConfiguration((NettyHttpComponent) component).setReuseAddress((boolean) value); return true;
             case "reuseChannel": getOrCreateConfiguration((NettyHttpComponent) component).setReuseChannel((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
index 6054654..7500e7d 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
@@ -125,6 +125,39 @@ public interface NettyHttpEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointConsumerBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointConsumerBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -2389,6 +2422,39 @@ public interface NettyHttpEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointProducerBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointProducerBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
@@ -4146,6 +4212,39 @@ public interface NettyHttpEndpointBuilderFactory {
             return this;
         }
         /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointBuilder hostnameVerification(
+                boolean hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
+         * To enable/disable hostname verification on SSLEngine.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: common
+         * 
+         * @param hostnameVerification the value to set
+         * @return the dsl builder
+         */
+        default NettyHttpEndpointBuilder hostnameVerification(
+                String hostnameVerification) {
+            doSetProperty("hostnameVerification", hostnameVerification);
+            return this;
+        }
+        /**
          * Setting to ensure socket is not closed due to inactivity.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
diff --git a/docs/components/modules/ROOT/pages/netty-http-component.adoc b/docs/components/modules/ROOT/pages/netty-http-component.adoc
index 666b33c..ef7da9f 100644
--- a/docs/components/modules/ROOT/pages/netty-http-component.adoc
+++ b/docs/components/modules/ROOT/pages/netty-http-component.adoc
@@ -99,7 +99,7 @@ related to UDP transport.
 
 
 // component options: START
-The Netty HTTP component supports 75 options, which are listed below.
+The Netty HTTP component supports 76 options, which are listed below.
 
 
 
@@ -108,6 +108,7 @@ The Netty HTTP component supports 75 options, which are listed below.
 | Name | Description | Default | Type
 | *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. |  | NettyConfiguration
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]
@@ -215,7 +216,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (79 parameters):
+=== Query Parameters (80 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -223,6 +224,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | *bridgeEndpoint* (common) | If the option is true, the producer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExceptionOnFailure to be false to let the producer send all the fault response back. The consumer working in the bridge mode will skip the gzip compression and WWW URL form encoding (by adding the Exchange.SKIP_GZIP_ENCODING and Exchange.SKIP_WWW_FORM_URLENCODED headers to the consumed exchange). | false | boolean
 | *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean
+| *hostnameVerification* (common) | To enable/disable hostname verification on SSLEngine | false | boolean
 | *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean
 | *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean
 | *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an e [...]


[camel] 01/03: CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit cc836cbf774392d674c826934b16f96f51351e8c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 8 14:01:11 2021 +0100

    CAMEL-16315 - Camel-Netty: Support Hostname verification even though we are on Netty 4.1.x
---
 .../component/netty/DefaultClientInitializerFactory.java    |  6 ++++++
 .../component/netty/DefaultServerInitializerFactory.java    |  6 ++++++
 .../apache/camel/component/netty/NettyConfiguration.java    | 13 +++++++++++++
 .../apache/camel/component/netty/ssl/SSLEngineFactory.java  |  1 +
 4 files changed, 26 insertions(+)

diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientInitializerFactory.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientInitializerFactory.java
index ab0b3b9..398603e 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientInitializerFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientInitializerFactory.java
@@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLParameters;
 
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
@@ -157,6 +158,11 @@ public class DefaultClientInitializerFactory extends ClientInitializerFactory {
         } else if (sslContext != null) {
             SSLEngine engine = sslContext.createSSLEngine();
             engine.setUseClientMode(true);
+            if (producer.getConfiguration().isHostnameVerification()) {
+                SSLParameters sslParams = engine.getSSLParameters();
+                sslParams.setEndpointIdentificationAlgorithm("HTTPS");
+                engine.setSSLParameters(sslParams);
+            }
             if (producer.getConfiguration().getSslContextParameters() == null) {
                 // just set the enabledProtocols if the SslContextParameter doesn't set
                 engine.setEnabledProtocols(producer.getConfiguration().getEnabledProtocols().split(","));
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerInitializerFactory.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerInitializerFactory.java
index dfb605d..8af4221 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerInitializerFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerInitializerFactory.java
@@ -20,6 +20,7 @@ import java.util.List;
 
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLParameters;
 
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
@@ -175,6 +176,11 @@ public class DefaultServerInitializerFactory extends ServerInitializerFactory {
             SSLEngine engine = sslContext.createSSLEngine();
             engine.setUseClientMode(consumer.getConfiguration().isClientMode());
             engine.setNeedClientAuth(consumer.getConfiguration().isNeedClientAuth());
+            if (consumer.getConfiguration().isHostnameVerification()) {
+                SSLParameters sslParams = engine.getSSLParameters();
+                sslParams.setEndpointIdentificationAlgorithm("HTTPS");
+                engine.setSSLParameters(sslParams);
+            }
             if (consumer.getConfiguration().getSslContextParameters() == null) {
                 // just set the enabledProtocols if the SslContextParameter doesn't set
                 engine.setEnabledProtocols(consumer.getConfiguration().getEnabledProtocols().split(","));
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
index 4315ccd..e9e9bc9 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
@@ -67,6 +67,8 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
     private List<ChannelHandler> encoders = new ArrayList<>();
     @UriParam(label = "codec")
     private List<ChannelHandler> decoders = new ArrayList<>();
+    @UriParam(label = "common", defaultValue = "true")
+    private boolean hostnameVerification = true;
     @UriParam
     private boolean disconnect;
     @UriParam(label = "producer,advanced", defaultValue = "true")
@@ -721,6 +723,17 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
         this.correlationManager = correlationManager;
     }
 
+    public boolean isHostnameVerification() {
+        return hostnameVerification;
+    }
+
+    /**
+     * To enable/disable hostname verification on SSLEngine
+     */
+    public void setHostnameVerification(boolean hostnameVerification) {
+        this.hostnameVerification = hostnameVerification;
+    }    
+
     private static <T> void addToHandlersList(List<T> configured, List<T> handlers, Class<T> handlerType) {
         if (handlers != null) {
             for (T handler : handlers) {
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
index ef77e79..ae99ecf 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/ssl/SSLEngineFactory.java
@@ -22,6 +22,7 @@ import java.security.KeyStore;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLParameters;
 import javax.net.ssl.TrustManagerFactory;
 
 import org.apache.camel.CamelContext;