applicationProtocols = applicationProtocols.stream().filter(v -> v != HttpVersion.HTTP_2).collect(Collectors.toList()); sslHelper.setApplicationProtocols(applicationProtocols); synchronized (vertx.sharedHttpServers()) { this.actualPort = port; // Will be updated on bind for a wildcard port
this.pipelining = options.isPipelining(); this.sslHelper = new SSLHelper(options, options.getKeyCertOptions(), options.getTrustOptions()). setApplicationProtocols(alpnVersions); sslHelper.validate(vertx); this.creatingContext = vertx.getContext();
applicationProtocols = applicationProtocols.stream().filter(v -> v != HttpVersion.HTTP_2).collect(Collectors.toList()); sslHelper.setApplicationProtocols(applicationProtocols); synchronized (vertx.sharedHttpServers()) { this.actualPort = port; // Will be updated on bind for a wildcard port
this.pipelining = options.isPipelining(); this.sslHelper = new SSLHelper(options, options.getKeyCertOptions(), options.getTrustOptions()). setApplicationProtocols(alpnVersions); sslHelper.validate(vertx); this.creatingContext = vertx.getContext();
private ActualServer(Vertx vertx, ServerID id, HttpServerOptions options, NettyServerBuilder builder) { // SSL if (options.isSsl()) { SSLHelper helper = new SSLHelper(options, options.getKeyCertOptions(), options.getTrustOptions()); helper.setApplicationProtocols(Collections.singletonList(HttpVersion.HTTP_2)); SslContext ctx = helper.getContext((VertxInternal) vertx); builder.sslContext(new DelegatingSslContext(ctx) { @Override protected void initEngine(SSLEngine engine) { helper.configureEngine(engine, null); } }); } Transport transport = ((VertxInternal) vertx).transport(); this.id = id; this.options = options; this.server = builder .executor(command -> { contextLocal.get().get(0).executeFromIO(event -> command.run()); }) .channelType(transport.serverChannelFactory(false).newChannel().getClass()) .bossEventLoopGroup(group) .workerEventLoopGroup(group) .build(); }
@Override public ManagedChannel build() { // SSL if (options.isSsl()) { SSLHelper helper = new SSLHelper(options, options.getKeyCertOptions(), options.getTrustOptions()); helper.setApplicationProtocols(Collections.singletonList(HttpVersion.HTTP_2)); SslContext ctx = helper.getContext((VertxInternal) vertx); builder.sslContext(new DelegatingSslContext(ctx) { @Override protected void initEngine(SSLEngine engine) { helper.configureEngine(engine, null); } }); } Transport transport = ((VertxInternal) vertx).transport(); return builder .eventLoopGroup(context.nettyEventLoop()) .channelType(transport.channelFactory(false).newChannel().getClass()) // Ugly work around / perhaps contribute change to grpc .executor(command -> { if (Context.isOnEventLoopThread()) { context.executeFromIO(event -> command.run()); } else { command.run(); } }).build(); } }