Examples of handshakeFuture()


Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

      }

      if (sslHelper.isSSL()) {
        SslHandler sslHandler = ch.pipeline().get(SslHandler.class);

        io.netty.util.concurrent.Future<Channel> fut = sslHandler.handshakeFuture();
        fut.addListener(future -> {
          if (future.isSuccess()) {
            connected(ch, handler);
          } else {
            log.error("Client from origin " + ch.remoteAddress() + " failed to connect over ssl");
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

                                // change state
                                this.state = State.SSL_WAIT;
                                // insert SSLHandler
                                SslHandler sslHandler = new SslHandler(sslEngine);
                                // get promise
                                Future<Channel> hsFuture = sslHandler.handshakeFuture();
                                // register callback
                                hsFuture.addListener(new SslListener());
                                // Add handler
                                chc.channel().pipeline().addFirst(Constants.SSL_HANDLER, sslHandler);
                                break;
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

         connectionListener.connectionCreated(NettyAcceptor.this, nc, protocol);

         SslHandler sslHandler = ctx.pipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            sslHandler.handshakeFuture().addListener(new GenericFutureListener<io.netty.util.concurrent.Future<Channel>>()
            {
               public void operationComplete(final io.netty.util.concurrent.Future<Channel> future) throws Exception
               {
                  if (future.isSuccess())
                  {
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

        Channels.setAttribute(channel, future);
        final HostnameVerifier hostnameVerifier = config.getHostnameVerifier();
        final SslHandler sslHandler = ChannelManager.getSslHandler(channel.pipeline());
        if (hostnameVerifier != null && sslHandler != null) {
            final String host = future.getUri().getHost();
            sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<? super Channel>>() {
                @Override
                public void operationComplete(Future<? super Channel> handshakeFuture) throws Exception {
                    if (handshakeFuture.isSuccess()) {
                        Channel channel = (Channel) handshakeFuture.getNow();
                        SSLEngine engine = sslHandler.engine();
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

        if (null != channel) {
            channel.config().setAutoRead(true);
        }
        SslHandler handler = new SslHandler(sslEngine);
        pipeline.addFirst("ssl", handler);
        return handler.handshakeFuture();
    }

    /**
     * Encrypts the channel using the provided {@link SSLEngine}.
     *
 
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

      }

      if (tcpHelper.isSSL()) {
        SslHandler sslHandler = ch.pipeline().get(SslHandler.class);

        Future<Channel> fut = sslHandler.handshakeFuture();
        fut.addListener(new GenericFutureListener<Future<Channel>>() {
          @Override
          public void operationComplete(Future<Channel> future) throws Exception {
            if (future.isSuccess()) {
              connected(ch, handler);
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

          if (tcpHelper.isSSL()) {
            // TCP connected, so now we must do the SSL handshake

            SslHandler sslHandler = ch.pipeline().get(SslHandler.class);

            Future<Channel> fut = sslHandler.handshakeFuture();
            fut.addListener(new GenericFutureListener<Future<Channel>>() {
              @Override
              public void operationComplete(Future<Channel> future) throws Exception {
                if (future.isSuccess()) {
                  connected(ch, connectHandler);
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

          if (tcpHelper.isSSL()) {
            // TCP connected, so now we must do the SSL handshake

            SslHandler sslHandler = ch.pipeline().get(SslHandler.class);

            Future<Channel> fut = sslHandler.handshakeFuture();
            fut.addListener(new GenericFutureListener<Future<Channel>>() {
              @Override
              public void operationComplete(Future<Channel> future) throws Exception {
                if (future.isSuccess()) {
                  connected(ch, connectHandler);
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler.handshakeFuture()

      {
         final Channel ch = future.channel();
         SslHandler sslHandler = ch.pipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            Future<Channel> handshakeFuture = sslHandler.handshakeFuture();
            if (handshakeFuture.awaitUninterruptibly(30000))
            {
               if (handshakeFuture.isSuccess())
               {
                  ChannelPipeline channelPipeline = ch.pipeline();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.