From 01adf96148a044017c6c23e5774c6748ae464652 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 18 Sep 2023 07:58:07 +0200 Subject: [PATCH] Update to SSLHelper change --- .../java/io/vertx/grpc/VertxChannelBuilder.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 25c844e9..7376783f 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()), context) + .toCompletionStage() + .toCompletableFuture() + .toCompletableFuture().get(1, TimeUnit.MINUTES); + provider = scp.sslContextProvider(); } catch (InterruptedException e) { throw new VertxException(e); } catch (ExecutionException e) {