@Override protected void initChannel(Channel ch) throws Exception { super.initChannel(ch); final SslHandler sslHandler = new SslHandler(sgks.createServerTransportSSLEngine()); ch.pipeline().addFirst("ssl_server", sslHandler); }
@Override public final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if(SearchGuardSSLNettyTransport.this.lifecycle.started()) { if(cause instanceof DecoderException && cause != null) { cause = cause.getCause(); } errorHandler.logError(cause, false); if(cause instanceof NotSslRecordException) { logger.warn("Someone ({}) speaks transport plaintext instead of ssl, will close the channel", ctx.channel().remoteAddress()); ctx.channel().close(); return; } else if (cause instanceof SSLException) { logger.error("SSL Problem "+cause.getMessage(),cause); ctx.channel().close(); return; } else if (cause instanceof SSLHandshakeException) { logger.error("Problem during handshake "+cause.getMessage()); ctx.channel().close(); return; } } super.exceptionCaught(ctx, cause); } }
protected ChannelHandler getServerChannelInitializer(String name) { return new ServerChannelInitializer(name); }
protected ChannelHandler getServerChannelInitializer(String name) { return new ServerChannelInitializer(name); }
protected ChannelHandler getServerChannelInitializer(String name) { return new ServerChannelInitializer(name); }
protected ChannelHandler getServerChannelInitializer(String name) { return new ServerChannelInitializer(name); }
@Override protected void initChannel(Channel ch) throws Exception { super.initChannel(ch); ChannelPipeline pipeline = ch.pipeline(); TlsConfig tlsConfig = config.getTlsConfig(); if (tlsConfig.isEnabledForTcp()) { SslHandler sslHandler = tlsConfig.createHandler(false); pipeline.addFirst("tls", sslHandler); } } }