From c3cecad027437c866b6d62e7819955e963ddc4a1 Mon Sep 17 00:00:00 2001 From: jaymode Date: Tue, 2 Aug 2016 15:50:17 -0400 Subject: [PATCH] add channel is closed check Original commit: elastic/x-pack-elasticsearch@04bcdf83089e9840452416dc55ec08596ad6a3f0 --- .../xpack/security/transport/ServerTransportFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java index 3b4a65d4650..c8849cabd41 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java @@ -91,8 +91,10 @@ public interface ServerTransportFilter { } else if (((TcpTransportChannel) unwrappedChannel).getChannel() instanceof io.netty.channel.Channel) { io.netty.channel.Channel channel = (io.netty.channel.Channel) ((TcpTransportChannel) unwrappedChannel).getChannel(); io.netty.handler.ssl.SslHandler sslHandler = channel.pipeline().get(io.netty.handler.ssl.SslHandler.class); - assert sslHandler != null : "channel [" + channel + "] did not have a ssl handler. pipeline " + channel.pipeline(); - extactClientCertificates(sslHandler.engine(), channel); + if (channel.isOpen()) { + assert sslHandler != null : "channel [" + channel + "] did not have a ssl handler. pipeline " + channel.pipeline(); + extactClientCertificates(sslHandler.engine(), channel); + } } }