Skip to content

Commit

Permalink
Merge branch 'vert-x3:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
yeikel authored Oct 5, 2023
2 parents 19b2df4 + 25a0d4e commit d4bdd32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
15 changes: 10 additions & 5 deletions vertx-grpc/src/main/java/io/vertx/grpc/VertxChannelBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 8 additions & 6 deletions vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d4bdd32

Please sign in to comment.