Examples of SSLHandler


Examples of by.stub.handlers.SslHandler

      final JettyContext jettyContext = new JettyContext(currentHost, isSsl, currentStubsPort, currentAdminPort);
      final HandlerList handlers = new HandlerList();
      handlers.setHandlers(new Handler[]
            {
                  constructHandler(STUBS_CONNECTOR_NAME, "/", new StubsHandler(dataStore)),
                  constructHandler(SSL_CONNECTOR_NAME, "/", new SslHandler(dataStore)),
                  constructHandler(SPDY_CONNECTOR_NAME, "/", new SpdyHandler(dataStore)),

                  constructHandler(ADMIN_CONNECTOR_NAME, "/stubdata/new", new StubsRegistrationHandler(dataStore, yamlParser)),
                  constructHandler(ADMIN_CONNECTOR_NAME, "/ping", new PingHandler(jettyContext, dataStore, yamlParser)),
                  constructHandler(ADMIN_CONNECTOR_NAME, "/", contextRootHandler("html/", "admin-index.html"))
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.handler.ssl.SslHandler

                SSLEngine sslEngine = SSLContext.getDefault().createSSLEngine(remoteAddress.getHostString(), remoteAddress.getPort());
                sslEngine.setSSLParameters(sslParameters);
                sslEngine.setUseClientMode(true);

                SslHandler sslHandler = new SslHandler(sslEngine);
                future.getChannel().getPipeline().addBefore("codec", "ssl", sslHandler);
                ChannelFuture handshakeFuture = sslHandler.handshake();
                handshakeFuture.addListener(callbackConnectionListener);
            }
            else {
                callbackConnectionListener.operationComplete(future);
            }
View Full Code Here

Examples of io.fletty.handler.ssl.SslHandler

        public void initChannel(SocketChannel ch) throws Exception {
            ChannelPipeline pipeline = ch.pipeline();
            SSLContext sslContext = Utils.createSSLContext();
            SSLEngine engine = sslContext.createSSLEngine();
            engine.setUseClientMode(true);
            pipeline.addLast("ssl", new SslHandler(engine));
            pipeline.addLast("framer", new LineBasedFrameDecoder(1000 * 1000 * 10, true, false));
            pipeline.addLast("decoder", new StringDecoder(CharsetUtil.UTF_8));
            pipeline.addLast("encoder", new StringEncoder(CharsetUtil.UTF_8));
            pipeline.addLast("handler", connection);
        }
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

    try {
      if (this.isTls.compareAndSet(false, true)) {
        SSLEngine engine = this.sslContextBuilder.build().createSSLEngine();
        engine.setNeedClientAuth(false);
        engine.setUseClientMode(false);
        this.handler = new SslHandler(engine);
        this.prepareTls.compareAndSet(false, true);
      }
      return true;
    } catch (Exception e) {
      log.error(e.toString());
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

        final ChannelPipeline pipeline = channel.pipeline();

        final SSLEngine sslEngine = feedbackConnection.sslContext.createSSLEngine();
        sslEngine.setUseClientMode(true);

        pipeline.addLast("ssl", new SslHandler(sslEngine));
        pipeline.addLast("readTimeoutHandler", new ReadTimeoutHandler(feedbackConnection.configuration.getReadTimeout()));
        pipeline.addLast("decoder", new ExpiredTokenDecoder());
        pipeline.addLast("handler", new FeedbackClientHandler(feedbackConnection));
      }
    });

    this.connectFuture = bootstrap.connect(this.environment.getFeedbackHost(), this.environment.getFeedbackPort());
    this.connectFuture.addListener(new GenericFutureListener<ChannelFuture>() {

      @Override
      public void operationComplete(final ChannelFuture connectFuture) {

        if (connectFuture.isSuccess()) {
          log.debug("{} connected; waiting for TLS handshake.", feedbackConnection.name);

          final SslHandler sslHandler = connectFuture.channel().pipeline().get(SslHandler.class);

          try {
            sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<Channel>>() {

              @Override
              public void operationComplete(final Future<Channel> handshakeFuture) {
                if (handshakeFuture.isSuccess()) {
                  log.debug("{} successfully completed TLS handshake.", feedbackConnection.name);
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

    final FeedbackServiceConnection feedbackConnection = this;

    return new Runnable() {
      @Override
      public void run() {
        final SslHandler sslHandler = feedbackConnection.connectFuture.channel().pipeline().get(SslHandler.class);

        if (feedbackConnection.connectFuture.isCancellable()) {
          feedbackConnection.connectFuture.cancel(true);
        } else if (sslHandler != null && sslHandler.handshakeFuture().isCancellable()) {
          sslHandler.handshakeFuture().cancel(true);
        } else {
          feedbackConnection.connectFuture.channel().close();
        }
      }
    };
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

    bootstrap.childHandler(new ChannelInitializer<SocketChannel>() {

      @Override
      protected void initChannel(final SocketChannel channel) throws Exception {
        channel.pipeline().addLast("ssl", new SslHandler(SSLTestUtil.createSSLEngineForMockServer()));
        channel.pipeline().addLast("encoder", new ApnsErrorEncoder());
        channel.pipeline().addLast("decoder", new ApnsPushNotificationDecoder());
        channel.pipeline().addLast("handler", new MockApnsServerHandler(server));
      }
    });
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

        final ChannelPipeline pipeline = channel.pipeline();

        final SSLEngine sslEngine = apnsConnection.sslContext.createSSLEngine();
        sslEngine.setUseClientMode(true);

        pipeline.addLast("ssl", new SslHandler(sslEngine));
        pipeline.addLast("decoder", new RejectedNotificationDecoder());
        pipeline.addLast("encoder", new ApnsPushNotificationEncoder());
        pipeline.addLast(ApnsConnection.PIPELINE_MAIN_HANDLER, new ApnsConnectionHandler(apnsConnection));
      }
    });

    log.debug("{} beginning connection process.", apnsConnection.name);
    this.connectFuture = bootstrap.connect(this.environment.getApnsGatewayHost(), this.environment.getApnsGatewayPort());
    this.connectFuture.addListener(new GenericFutureListener<ChannelFuture>() {

      @Override
      public void operationComplete(final ChannelFuture connectFuture) {
        if (connectFuture.isSuccess()) {
          log.debug("{} connected; waiting for TLS handshake.", apnsConnection.name);

          final SslHandler sslHandler = connectFuture.channel().pipeline().get(SslHandler.class);

          try {
            sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<Channel>>() {

              @Override
              public void operationComplete(final Future<Channel> handshakeFuture) {
                if (handshakeFuture.isSuccess()) {
                  log.debug("{} successfully completed TLS handshake.", apnsConnection.name);
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

    final ApnsConnection<T> apnsConnection = this;

    return new Runnable() {
      @Override
      public void run() {
        final SslHandler sslHandler = apnsConnection.connectFuture.channel().pipeline().get(SslHandler.class);

        if (apnsConnection.connectFuture.isCancellable()) {
          apnsConnection.connectFuture.cancel(true);
        } else if (sslHandler != null && sslHandler.handshakeFuture().isCancellable()) {
          sslHandler.handshakeFuture().cancel(true);
        } else {
          apnsConnection.connectFuture.channel().close();
        }
      }
    };
View Full Code Here

Examples of io.netty.handler.ssl.SslHandler

    final MockFeedbackServer server = this;
    bootstrap.childHandler(new ChannelInitializer<SocketChannel>() {

      @Override
      protected void initChannel(final SocketChannel channel) throws Exception {
        channel.pipeline().addLast("ssl", new SslHandler(SSLTestUtil.createSSLEngineForMockServer()));
        channel.pipeline().addLast("encoder", new ExpiredTokenEncoder());
        channel.pipeline().addLast("handler", new MockFeedbackServerHandler(server));
      }
    });
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.