boolean isHttp2Protocol(SslHandler sslHandler) { return ApplicationProtocolNames.HTTP_2.equals(sslHandler.applicationProtocol()); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { if (evt instanceof SslHandshakeCompletionEvent) { // Notify application SslHandshakeCompletionEvent completion = (SslHandshakeCompletionEvent) evt; if (completion.isSuccess()) { // Remove from the pipeline after handshake result ctx.pipeline().remove(this); applicationProtocol = sslHandler.applicationProtocol(); channelHandler.handle(io.vertx.core.Future.succeededFuture(channel)); } else { SSLHandshakeException sslException = new SSLHandshakeException("Failed to create SSL connection"); sslException.initCause(completion.cause()); channelHandler.handle(io.vertx.core.Future.failedFuture(sslException)); } } ctx.fireUserEventTriggered(evt); } @Override
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
if (options.isUseAlpn()) { SslHandler sslHandler = pipeline.get(SslHandler.class); String protocol = sslHandler.applicationProtocol(); if ("h2".equals(protocol)) { handleHttp2(ch);
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { if (evt instanceof SslHandshakeCompletionEvent) { // Notify application SslHandshakeCompletionEvent completion = (SslHandshakeCompletionEvent) evt; if (completion.isSuccess()) { // Remove from the pipeline after handshake result ctx.pipeline().remove(this); applicationProtocol = sslHandler.applicationProtocol(); channelHandler.handle(io.vertx.core.Future.succeededFuture(channel)); } else { SSLHandshakeException sslException = new SSLHandshakeException("Failed to create SSL connection"); sslException.initCause(completion.cause()); channelHandler.handle(io.vertx.core.Future.failedFuture(sslException)); } } ctx.fireUserEventTriggered(evt); } @Override
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
if (options.isUseAlpn()) { SslHandler sslHandler = pipeline.get(SslHandler.class); String protocol = sslHandler.applicationProtocol(); if ("h2".equals(protocol)) { handleHttp2(ch);
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof SslHandshakeCompletionEvent) { ctx.pipeline().remove(this); SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt; if (handshakeEvent.isSuccess()) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); if (sslHandler == null) { throw new IllegalStateException("cannot find a SslHandler in the pipeline (required for " + "application-level protocol negotiation)"); } String protocol = sslHandler.applicationProtocol(); configurePipeline(ctx, protocol != null? protocol : fallbackProtocol); } else { handshakeFailure(ctx, handshakeEvent.cause()); } } ctx.fireUserEventTriggered(evt); }
return; String protocol = sslHandler.applicationProtocol(); if (ApplicationProtocolNames.HTTP_2.equals(protocol))