Skip to content

Commit

Permalink
Merge pull request #38092 from alesj/i38067_2
Browse files Browse the repository at this point in the history
Always set ssl and alpn for non-plain-text with Vert.x gRPC channel
  • Loading branch information
cescoffier authored Jan 9, 2024
2 parents 49e95bb + bea4297 commit e4585da
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,16 @@ public static Channel createChannel(String name, Set<String> 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<Path> 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<Path> certificatePath = config.ssl.certificate;
Optional<Path> keyPath = config.ssl.key;
Expand All @@ -270,8 +272,6 @@ public static Channel createChannel(String name, Set<String> perClientIntercepto
cko.setCertValue(bufferFor(certificatePath.get(), "certificate"));
cko.setKeyValue(bufferFor(keyPath.get(), "key"));
options.setKeyCertOptions(cko);
options.setSsl(true);
options.setUseAlpn(true);
}
}
}
Expand Down

0 comments on commit e4585da

Please sign in to comment.