diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java b/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java index 85071f82bde..619098c208c 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java @@ -57,7 +57,9 @@ public class NettySecuredHttpServerTransport extends NettyHttpServerTransport { @Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = super.getPipeline(); - pipeline.addFirst("ipfilter", shieldUpstreamHandler); + if (settings.getAsBoolean("shield.n2n.enabled", true)) { + pipeline.addFirst("ipfilter", shieldUpstreamHandler); + } if (ssl) { SSLEngine engine = sslConfig.createSSLEngine(); engine.setUseClientMode(false); diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java b/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java index 2557c731a46..60dcf8813db 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java @@ -64,7 +64,9 @@ public class NettySecuredTransport extends NettyTransport { @Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = super.getPipeline(); - pipeline.addFirst("ipfilter", shieldUpstreamHandler); + if (settings.getAsBoolean("shield.n2n.enabled", true)) { + pipeline.addFirst("ipfilter", shieldUpstreamHandler); + } if (ssl) { SSLEngine serverEngine = sslConfig.createSSLEngine(); serverEngine.setUseClientMode(false);