public SSLEngine createEngine(SslContext sslContext) { SSLEngine engine = sslContext.newEngine(ByteBufAllocator.DEFAULT); configureEngine(engine, null); return engine; }
/** * Create a new SslHandler. * @see #newHandler(ByteBufAllocator) */ protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls) { return new SslHandler(newEngine(alloc), startTls); }
@Override public final SSLEngine newEngine(ByteBufAllocator alloc) { SSLEngine engine = ctx.newEngine(alloc); initEngine(engine); return engine; }
/** * Create a new SslHandler. * @see #newHandler(ByteBufAllocator, String, int, boolean) */ protected SslHandler newHandler(ByteBufAllocator alloc, String peerHost, int peerPort, boolean startTls) { return new SslHandler(newEngine(alloc, peerHost, peerPort), startTls); }
@Override public final SSLEngine newEngine(ByteBufAllocator alloc, String peerHost, int peerPort) { SSLEngine engine = ctx.newEngine(alloc, peerHost, peerPort); initEngine(engine); return engine; }
private SslHandler createSslHandler( ChannelHandlerContext ctx, InetSocketAddress inetSocketAddress ) { SSLEngine sslEngine = sslContext.newEngine( ctx.alloc(), inetSocketAddress.getHostName(), inetSocketAddress.getPort() ); for ( Function<SSLEngine,SSLEngine> mod : engineModifications ) { sslEngine = mod.apply( sslEngine ); } // Don't need to set tls versions since that is set up from the context return new SslHandler( sslEngine ); }
/** * Create a new SslHandler. * @see #newHandler(ByteBufAllocator) */ protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls) { return new SslHandler(newEngine(alloc), startTls); }
@Override public final SSLEngine newEngine(ByteBufAllocator alloc, String peerHost, int peerPort) { SSLEngine engine = ctx.newEngine(alloc, peerHost, peerPort); initEngine(engine); return engine; }
/** * Create a new SslHandler. * @see #newHandler(ByteBufAllocator, String, int, boolean) */ protected SslHandler newHandler(ByteBufAllocator alloc, String peerHost, int peerPort, boolean startTls) { return new SslHandler(newEngine(alloc, peerHost, peerPort), startTls); }
@Override public final SSLEngine newEngine(ByteBufAllocator alloc) { SSLEngine engine = ctx.newEngine(alloc); initEngine(engine); return engine; }
@Override public SSLEngine newSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort) { SSLEngine sslEngine = config.isDisableHttpsEndpointIdentificationAlgorithm() ? sslContext.newEngine(ByteBufAllocator.DEFAULT) : sslContext.newEngine(ByteBufAllocator.DEFAULT, domain(peerHost), peerPort); configureSslEngine(sslEngine, config); return sslEngine; }
public SSLEngine createEngine(VertxInternal vertx, String host, int port, boolean forceSNI) { SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT, host, port); configureEngine(engine, forceSNI ? host : null); return engine; }
public SSLEngine createEngine(VertxInternal vertx, String host, int port) { SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT, host, port); configureEngine(engine, null); return engine; }
public SSLEngine createEngine(VertxInternal vertx) { SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT); configureEngine(engine, null); return engine; } }
private ChannelHandler nettyServerHandler( Channel channel, SslContext sslContext ) { SSLEngine sslEngine = sslContext.newEngine( channel.alloc() ); return new SslHandler( sslEngine ); }
public SSLEngine createEngine(VertxInternal vertx, SocketAddress socketAddress, String serverName) { SslContext context = getContext(vertx, null); SSLEngine engine; if (socketAddress.path() != null) { engine = context.newEngine(ByteBufAllocator.DEFAULT); } else { engine = context.newEngine(ByteBufAllocator.DEFAULT, socketAddress.host(), socketAddress.port()); } configureEngine(engine, serverName); return engine; }
@Override protected void initChannel(Channel ch) throws Exception { SSLEngine engine = context.newEngine(ch.alloc()); ch.pipeline().addFirst("ssl", new SslHandler(engine, startTls)); } }
@Override protected void initChannel(Channel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); SSLEngine engine = context.newEngine(ch.alloc()); pipeline.addFirst("ssl", new SslHandler(engine)); if (isClient) { pipeline.addLast("codec", new HttpClientCodec()); } else { pipeline.addLast("codec", new HttpServerCodec()); } } }
@Override public SSLEngine clientSslEngineFor(HttpRequest httpRequest, SSLSession sslSession) { String requestedHostname = HttpUtil.getHostFromRequest(httpRequest); try { SslContext ctx = getHostnameImpersonatingSslContext(requestedHostname, sslSession); return ctx.newEngine(ByteBufAllocator.DEFAULT); } catch (RuntimeException e) { throw new MitmException("Error creating SSLEngine for connection to client to impersonate upstream host: " + requestedHostname, e); } }