NettyClientSslHandlerFactory extends AbstractNettySslHandlerFactory { @Override public SslHandler createSslHandler(SocketChannel channel) { SslHandler sslHandler = getNettySslContext().newHandler(channel.alloc()); return getCustomizedSslHandler(sslHandler); } NettyClientSslHandlerFactory(TLSConfig config); @Override SslHandler createSslHandler(SocketChannel channel);  }
@Test public void testCreateSslHandler() { ChannelHandler handler = factory.createSslHandler(new NioSocketChannel()); Assert.assertTrue(handler instanceof SslHandler); }
@Test public void testReflection() { SslHandler sslHandler = (SslHandler) factory.createSslHandler(new NioSocketChannel()); try { Field field = SslHandler.class.getDeclaredField("maxPacketBufferSize"); field.setAccessible(true); field.set(sslHandler, 8192); Assert.assertEquals(field.get(sslHandler), 8192); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } }