diff --git a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java index bd9abdde4b..c05496466c 100644 --- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java @@ -34,6 +34,7 @@ import io.netty.channel.ChannelPromiseNotifier; import io.netty.channel.PendingWriteQueue; import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.UnsupportedMessageTypeException; +import io.netty.util.ReferenceCounted; import io.netty.util.concurrent.DefaultPromise; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.Future; @@ -580,8 +581,8 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH // Check if queue is not empty first because create a new ChannelException is expensive pendingUnencryptedWrites.removeAndFailAll(new ChannelException("Pending write on removal of SslHandler")); } - if (engine instanceof ReferenceCountedOpenSslEngine) { - ((ReferenceCountedOpenSslEngine) engine).release(); + if (engine instanceof ReferenceCounted) { + ((ReferenceCounted) engine).release(); } }