add channel is closed check

Original commit: elastic/x-pack-elasticsearch@04bcdf8308
This commit is contained in:
jaymode 2016-08-02 15:50:17 -04:00
parent 7a3932de94
commit c3cecad027
1 changed files with 4 additions and 2 deletions

View File

@ -91,10 +91,12 @@ public interface ServerTransportFilter {
} else if (((TcpTransportChannel) unwrappedChannel).getChannel() instanceof io.netty.channel.Channel) { } else if (((TcpTransportChannel) unwrappedChannel).getChannel() instanceof io.netty.channel.Channel) {
io.netty.channel.Channel channel = (io.netty.channel.Channel) ((TcpTransportChannel) unwrappedChannel).getChannel(); 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); io.netty.handler.ssl.SslHandler sslHandler = channel.pipeline().get(io.netty.handler.ssl.SslHandler.class);
if (channel.isOpen()) {
assert sslHandler != null : "channel [" + channel + "] did not have a ssl handler. pipeline " + channel.pipeline(); assert sslHandler != null : "channel [" + channel + "] did not have a ssl handler. pipeline " + channel.pipeline();
extactClientCertificates(sslHandler.engine(), channel); extactClientCertificates(sslHandler.engine(), channel);
} }
} }
}
Authentication authentication = authcService.authenticate(securityAction, request, null); Authentication authentication = authcService.authenticate(securityAction, request, null);
authzService.authorize(authentication, securityAction, request); authzService.authorize(authentication, securityAction, request);