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:
parent
c9379b3875
commit
f73645054b
|
@ -57,7 +57,9 @@ public class NettySecuredHttpServerTransport extends NettyHttpServerTransport {
|
||||||
@Override
|
@Override
|
||||||
public ChannelPipeline getPipeline() throws Exception {
|
public ChannelPipeline getPipeline() throws Exception {
|
||||||
ChannelPipeline pipeline = super.getPipeline();
|
ChannelPipeline pipeline = super.getPipeline();
|
||||||
|
if (settings.getAsBoolean("shield.n2n.enabled", true)) {
|
||||||
pipeline.addFirst("ipfilter", shieldUpstreamHandler);
|
pipeline.addFirst("ipfilter", shieldUpstreamHandler);
|
||||||
|
}
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
SSLEngine engine = sslConfig.createSSLEngine();
|
SSLEngine engine = sslConfig.createSSLEngine();
|
||||||
engine.setUseClientMode(false);
|
engine.setUseClientMode(false);
|
||||||
|
|
|
@ -64,7 +64,9 @@ public class NettySecuredTransport extends NettyTransport {
|
||||||
@Override
|
@Override
|
||||||
public ChannelPipeline getPipeline() throws Exception {
|
public ChannelPipeline getPipeline() throws Exception {
|
||||||
ChannelPipeline pipeline = super.getPipeline();
|
ChannelPipeline pipeline = super.getPipeline();
|
||||||
|
if (settings.getAsBoolean("shield.n2n.enabled", true)) {
|
||||||
pipeline.addFirst("ipfilter", shieldUpstreamHandler);
|
pipeline.addFirst("ipfilter", shieldUpstreamHandler);
|
||||||
|
}
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
SSLEngine serverEngine = sslConfig.createSSLEngine();
|
SSLEngine serverEngine = sslConfig.createSSLEngine();
|
||||||
serverEngine.setUseClientMode(false);
|
serverEngine.setUseClientMode(false);
|
||||||
|
|
Loading…
Reference in New Issue