From bea42972acb01c70e768d7a00e82827f7caf92dc Mon Sep 17 00:00:00 2001 From: Ales Justin Date: Mon, 8 Jan 2024 18:31:01 +0100 Subject: [PATCH] Always set ssl and alpn for non-plain-text with Vert.x gRPC channel --- .../java/io/quarkus/grpc/runtime/supports/Channels.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports/Channels.java b/extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports/Channels.java index 4e66fd21023bb..65831169c0b03 100644 --- a/extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports/Channels.java +++ b/extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports/Channels.java @@ -254,14 +254,16 @@ public static Channel createChannel(String name, Set perClientIntercepto options.setHttp2ClearTextUpgrade(false); // this fixes i30379 if (!plainText) { + // always set ssl + alpn for plain-text=false + options.setSsl(true); + options.setUseAlpn(true); + if (config.ssl.trustStore.isPresent()) { Optional trustStorePath = config.ssl.trustStore; if (trustStorePath.isPresent()) { PemTrustOptions to = new PemTrustOptions(); to.addCertValue(bufferFor(trustStorePath.get(), "trust store")); options.setTrustOptions(to); - options.setSsl(true); - options.setUseAlpn(true); } Optional certificatePath = config.ssl.certificate; Optional keyPath = config.ssl.key; @@ -270,8 +272,6 @@ public static Channel createChannel(String name, Set perClientIntercepto cko.setCertValue(bufferFor(certificatePath.get(), "certificate")); cko.setKeyValue(bufferFor(keyPath.get(), "key")); options.setKeyCertOptions(cko); - options.setSsl(true); - options.setUseAlpn(true); } } }