diff --git a/vertx-grpc/src/main/java/io/vertx/grpc/VertxChannelBuilder.java b/vertx-grpc/src/main/java/io/vertx/grpc/VertxChannelBuilder.java index 25c844e..a3bd288 100644 --- a/vertx-grpc/src/main/java/io/vertx/grpc/VertxChannelBuilder.java +++ b/vertx-grpc/src/main/java/io/vertx/grpc/VertxChannelBuilder.java @@ -19,16 +19,15 @@ import io.grpc.internal.GrpcUtil; import io.grpc.netty.NettyChannelBuilder; import io.netty.handler.ssl.SslContext; +import io.vertx.core.*; import io.vertx.core.Context; -import io.vertx.core.Handler; -import io.vertx.core.Vertx; -import io.vertx.core.VertxException; import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpVersion; import io.vertx.core.impl.ContextInternal; import io.vertx.core.impl.VertxInternal; import io.vertx.core.net.ClientOptionsBase; import io.vertx.core.net.impl.SSLHelper; +import io.vertx.core.net.impl.SslChannelProvider; import io.vertx.core.net.impl.SslContextProvider; import io.vertx.core.spi.transport.Transport; @@ -284,8 +283,14 @@ public ManagedChannel build() { ContextInternal other = ((VertxInternal) vertx).createWorkerContext(); SslContextProvider provider; try { - SSLHelper helper = new SSLHelper(options, Collections.singletonList(HttpVersion.HTTP_2.alpnName())); - provider = helper.buildContextProvider(options.getSslOptions(), other).toCompletionStage().toCompletableFuture().get(1, TimeUnit.MINUTES); + // options, Collections.singletonList(HttpVersion.HTTP_2.alpnName()) + SSLHelper helper = new SSLHelper(SSLHelper.resolveEngineOptions(options.getSslEngineOptions(), true)); + SslChannelProvider scp = helper + .resolveSslChannelProvider(options.getSslOptions(), "", false, null, Collections.singletonList(HttpVersion.HTTP_2.alpnName()), other) + .toCompletionStage() + .toCompletableFuture() + .toCompletableFuture().get(1, TimeUnit.MINUTES); + provider = scp.sslContextProvider(); } catch (InterruptedException e) { throw new VertxException(e); } catch (ExecutionException e) { diff --git a/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java b/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java index 837a169..87a1d65 100644 --- a/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java +++ b/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java @@ -29,10 +29,7 @@ import io.vertx.core.impl.ContextInternal; import io.vertx.core.impl.future.PromiseInternal; import io.vertx.core.impl.VertxInternal; -import io.vertx.core.net.impl.SSLHelper; -import io.vertx.core.net.impl.ServerID; -import io.vertx.core.net.impl.SslContextProvider; -import io.vertx.core.net.impl.VertxEventLoopGroup; +import io.vertx.core.net.impl.*; import io.vertx.core.spi.transport.Transport; import java.io.IOException; @@ -75,8 +72,13 @@ private ActualServer(VertxInternal vertx, ContextInternal other = vertx.createWorkerContext(); SslContextProvider provider; try { - SSLHelper helper = new SSLHelper(options, Collections.singletonList(HttpVersion.HTTP_2.alpnName())); - provider = helper.buildContextProvider(options.getSslOptions(), other).toCompletionStage().toCompletableFuture().get(1, TimeUnit.MINUTES); + SSLHelper helper = new SSLHelper(SSLHelper.resolveEngineOptions(options.getSslEngineOptions(), true)); + SslChannelProvider scp = helper + .resolveSslChannelProvider(options.getSslOptions(), "", false, options.getClientAuth(), Collections.singletonList(HttpVersion.HTTP_2.alpnName()), other) + .toCompletionStage() + .toCompletableFuture() + .toCompletableFuture().get(1, TimeUnit.MINUTES); + provider = scp.sslContextProvider(); } catch (InterruptedException e) { throw new VertxException(e); } catch (ExecutionException e) {