Package io.netty.handler.ssl

Examples of io.netty.handler.ssl.SslHandler


    private void enableSsl(ChannelHandlerContext ctx) {
        ChannelPipeline pipeline = ctx.pipeline();
        SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
        engine.setUseClientMode(false);
        pipeline.addLast("ssl", new SslHandler(engine));

        // re-unify
        pipeline.addLast("sslUnification", new ProxyUnificationHandler(false, socksEnabled, port));
        pipeline.remove(this);
    }
View Full Code Here


                ChannelPipeline pipeline = ch.pipeline();

                // add HTTPS support
                SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
                engine.setUseClientMode(false);
                pipeline.addLast(SslHandler.class.getSimpleName(), new SslHandler(engine));

                // add HTTP decoder and encoder
                pipeline.addLast(HttpServerCodec.class.getSimpleName(), new HttpServerCodec());
                pipeline.addLast(HttpObjectAggregator.class.getSimpleName(), new HttpObjectAggregator(Integer.MAX_VALUE));
View Full Code Here

                ChannelPipeline pipeline = ch.pipeline();

                // add HTTPS client -> proxy support
                SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
                engine.setUseClientMode(false);
                pipeline.addLast("ssl inbound", new SslHandler(engine));

                // add handler
                InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);
                pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, true, 1048576, new RequestInterceptor(remoteSocketAddress), "                -->"));
View Full Code Here

                        // add HTTPS proxy -> server support
                        if (secure) {
                            SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
                            engine.setUseClientMode(true);
                            pipeline.addLast("proxy -> server ssl", new SslHandler(engine));
                        }

                        // add handler
                        pipeline.addLast(new ProxyRelayHandler(inboundChannel, bufferedCapacity, new ResponseInterceptor(), logger));
                    }
View Full Code Here

                                // add HTTPS support
                                if (secure) {
                                    SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
                                    engine.setUseClientMode(false);
                                    pipeline.addLast("ssl", new SslHandler(engine));
                                }

                                // pipeline.addLast("logger", new LoggingHandler("BOOK_HANDLER"));
                                pipeline.addLast("http_codec", new HttpServerCodec());
                                pipeline.addLast("simple_test_handler", new BookHandler());
View Full Code Here

                                    ChannelPipeline pipeline = ch.pipeline();

                                    pipeline.addLast("raw logger", new LoggingHandler("RAW TEST_SERVER_SSL"));
                                    SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
                                    engine.setUseClientMode(false);
                                    pipeline.addLast("ssl", new SslHandler(engine));
                                    pipeline.addLast("logger", new LoggingHandler("TEST_SERVER_SSL"));
                                    pipeline.addLast("codec", new HttpServerCodec());
                                    pipeline.addLast("chunk-aggregator", new HttpObjectAggregator(10 * 1024 * 1024));
                                    pipeline.addLast("handler", new TestServerHandler());
                                }
View Full Code Here

        // add HTTPS support
        if (secure) {
            SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();
            engine.setUseClientMode(false);
            pipeline.addLast("ssl", new SslHandler(engine));
        }

        // add logging
        if (logger.isDebugEnabled()) {
            pipeline.addLast("logger", new LoggingHandler());
View Full Code Here

                                            // downstream
                                            if (secure) {
                                                SSLEngine clientEngine = SSLFactory.getInstance().sslContext().createSSLEngine();
                                                clientEngine.setUseClientMode(true);
                                                outboundChannel.pipeline().addLast("outbound relay ssl", new SslHandler(clientEngine));
                                            }
                                            Logger outboundLogger = LoggerFactory.getLogger("                -->");
                                            if (logger.isDebugEnabled()) {
                                                outboundChannel.pipeline().addLast("outbound relay logger", new LoggingHandler(outboundLogger));
                                            }
                                            outboundChannel.pipeline().addLast(new ProxyRelayHandler(ctx.channel(), 1048576, new RequestInterceptor(null), outboundLogger));


                                            // upstream
                                            if (secure) {
                                                SSLEngine serverEngine = SSLFactory.getInstance().sslContext().createSSLEngine();
                                                serverEngine.setUseClientMode(false);
                                                ctx.channel().pipeline().addLast("upstream relay ssl", new SslHandler(serverEngine));
                                            }
                                            Logger inboundLogger = LoggerFactory.getLogger("<-- ");
                                            if (logger.isDebugEnabled()) {
                                                ctx.channel().pipeline().addLast("upstream relay logger", new LoggingHandler(inboundLogger));
                                            }
View Full Code Here

               else
               {
                  engine.setEnabledProtocols(originalProtocols);
               }

               SslHandler handler = new SslHandler(engine);

               pipeline.addLast("ssl", handler);
            }
            pipeline.addLast(protocolHandler.getProtocolDecoder());
         }
View Full Code Here

               engine.setUseClientMode(false);

               if (needClientAuth)
                  engine.setNeedClientAuth(true);

               SslHandler handler = new SslHandler(engine);

               pipeline.addLast("ssl", handler);
            }
            pipeline.addLast(protocolHandler.getProtocolDecoder());
         }
View Full Code Here

TOP

Related Classes of io.netty.handler.ssl.SslHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.