Ip Filter: Allow to disable via node configuration

Added `shield.n2n.enabled` property to disable this feature, so
it does not get added to the netty pipeline.

Original commit: elastic/x-pack-elasticsearch@d73d27619c
This commit is contained in:
Alexander Reelsen 2014-08-28 16:34:27 +02:00
parent c9379b3875
commit f73645054b
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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);