Package org.jboss.netty.handler.ssl

Examples of org.jboss.netty.handler.ssl.SslHandler$PendingWrite


        SSLContext sslContext = SSLContext.getInstance("TLS");
        sslContext.init(null, new TrustManager[]{new BogusTrustManager()},
                        null);
        SSLEngine sslEngine = sslContext.createSSLEngine();
        sslEngine.setUseClientMode(true);
        pipeline.addFirst("ssl", new SslHandler(sslEngine));
        return super.newChannel(pipeline);
      } catch (Exception ex) {
        throw new RuntimeException("Cannot create SSL channel", ex);
      }
    }
View Full Code Here


    @Override
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      SSLEngine sslEngine = createServerSSLContext().createSSLEngine();
      sslEngine.setUseClientMode(false);
      pipeline.addLast("ssl", new SslHandler(sslEngine));
      return pipeline;
    }
View Full Code Here

    @Override
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      if (sslFactory != null) {
        pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine()));
      }
      pipeline.addLast("decoder", new HttpRequestDecoder());
      pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16));
      pipeline.addLast("encoder", new HttpResponseEncoder());
      pipeline.addLast("chunking", new ChunkedWriteHandler());
View Full Code Here

    @Override
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      if (sslFactory != null) {
        pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine()));
      }
      pipeline.addLast("decoder", new HttpRequestDecoder());
      pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16));
      pipeline.addLast("encoder", new HttpResponseEncoder());
      pipeline.addLast("chunking", new ChunkedWriteHandler());
View Full Code Here

    @Override
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      if (sslFactory != null) {
        pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine()));
      }
      pipeline.addLast("decoder", new HttpRequestDecoder());
      pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16));
      pipeline.addLast("encoder", new HttpResponseEncoder());
      pipeline.addLast("chunking", new ChunkedWriteHandler());
View Full Code Here

      @Override
      public void channelConnected(final ChannelHandlerContext ctx, final ChannelStateEvent e) throws Exception
      {
         new NettyConnection(NettyAcceptor.this, e.getChannel(), new Listener(), !httpEnabled && batchDelay > 0, directDeliver);

         SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            sslHandler.handshake().addListener(new ChannelFutureListener()
            {
               public void operationComplete(final ChannelFuture future) throws Exception
               {
                  if (future.isSuccess())
                  {
View Full Code Here

      if (closed)
      {
         return;
      }

      SslHandler sslHandler = (SslHandler)channel.getPipeline().get("ssl");
      if (sslHandler != null)
      {
         try
         {
            ChannelFuture sslCloseFuture = sslHandler.close();

            if (!sslCloseFuture.awaitUninterruptibly(10000))
            {
               NettyConnection.log.warn("Timed out waiting for ssl close future to complete");
            }
View Full Code Here

            {
               SSLEngine engine = context.createSSLEngine();

               engine.setUseClientMode(false);

               SslHandler handler = new SslHandler(engine);

               handlers.put("ssl", handler);
            }

            if (httpEnabled)
            {
               handlers.put("http-decoder", new HttpRequestDecoder());
              
               handlers.put("http-aggregator", new HttpChunkAggregator(Integer.MAX_VALUE));

               handlers.put("http-encoder", new HttpResponseEncoder());

               httpHandler = new HttpAcceptorHandler(httpKeepAliveRunnable, httpResponseTime);
               handlers.put("http-handler", httpHandler);
            }

            if (protocol == ProtocolType.CORE)
            {
               // Core protocol uses its own optimised decoder

               handlers.put("hornetq-decoder", new HornetQFrameDecoder2());
            }
            else if (protocol == ProtocolType.STOMP_WS)
            {
               handlers.put("http-decoder", new HttpRequestDecoder());
               handlers.put("http-aggregator", new HttpChunkAggregator(65536));
               handlers.put("http-encoder", new HttpResponseEncoder());
               handlers.put("hornetq-decoder", new HornetQFrameDecoder(decoder));
               handlers.put("websocket-handler", new WebSocketServerHandler());
            }
            else if (protocol == ProtocolType.STOMP)
            {
               //With STOMP the decoding is handled in the StompFrame class
            }
            else
            {
               handlers.put("hornetq-decoder", new HornetQFrameDecoder(decoder));
            }

            handlers.put("handler", new HornetQServerChannelHandler(channelGroup, handler, new Listener()));

            /**
             * STOMP_WS protocol mandates use of named handlers to be able to replace http codecs
             * by websocket codecs after handshake.
             * Other protocols can use a faster static channel pipeline directly.
             */
            ChannelPipeline pipeline;
            if (protocol == ProtocolType.STOMP_WS)
            {
               pipeline = new DefaultChannelPipeline();
               for (Entry<String, ChannelHandler> handler : handlers.entrySet())
               {
                  pipeline.addLast(handler.getKey(), handler.getValue());
               }
            }
            else
            {
               pipeline = new StaticChannelPipeline(handlers.values().toArray(new ChannelHandler[handlers.size()]));
View Full Code Here

            SSLEngine engine = getSSLContext().createSSLEngine();
            engine.setUseClientMode(false);
            if (enabledCipherSuites != null && enabledCipherSuites.length > 0) {
                engine.setEnabledCipherSuites(enabledCipherSuites);
            }
            pipeline.addFirst("sslHandler", new SslHandler(engine));
        }
        return pipeline;
    }
View Full Code Here

     * @see org.apache.james.api.protocol.TLSSupportedSession#startTLS()
     */
    public void startTLS() throws IOException {
        if (isStartTLSSupported() && isTLSStarted() == false) {
            getChannelHandlerContext().getChannel().setReadable(false);
            SslHandler filter = new SslHandler(engine);
            filter.getEngine().setUseClientMode(false);
            resetState();
            getChannelHandlerContext().getPipeline().addFirst("sslHandler", filter);
            getChannelHandlerContext().getChannel().setReadable(true);
        }
       
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.ssl.SslHandler$PendingWrite

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.