From 1d407205f6eaac5ea00d5c84f8f88fa5093386e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A8=D1=83=D0=BC=D0=BE=D0=B2=20=D0=98=D0=B3=D0=BE=D1=80?= =?UTF-8?q?=D1=8C=20=D0=AE=D1=80=D1=8C=D0=B5=D0=B2=D0=B8=D1=87=20=20=28403?= =?UTF-8?q?8703=29?= Date: Wed, 17 Nov 2021 10:00:13 +0300 Subject: [PATCH] Add support of mTLS in Spring Cloud Config Client --- .../runtime/VertxSpringCloudConfigGateway.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java b/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java index 39c01eb02c600..081a525469ecf 100644 --- a/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java +++ b/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java @@ -77,15 +77,16 @@ public static WebClient createHttpClient(Vertx vertx, SpringCloudConfigClientCon } } else if (trustAll) { skipVerify(webClientOptions); - } else if (springCloudConfig.keyStore.isPresent()) { - Path trustStorePath = springCloudConfig.keyStore.get(); - String type = determineStoreType(trustStorePath); - KeyStoreOptionsBase storeOptions = storeOptions(trustStorePath, springCloudConfig.keyStorePassword, + } + if (springCloudConfig.keyStore.isPresent()) { + Path keyStorePath = springCloudConfig.keyStore.get(); + String type = determineStoreType(keyStorePath); + KeyStoreOptionsBase storeOptions = storeOptions(keyStorePath, springCloudConfig.keyStorePassword, createStoreOptions(type)); if (isPfx(type)) { - webClientOptions.setPfxTrustOptions((PfxOptions) storeOptions); + webClientOptions.setPfxKeyCertOptions((PfxOptions) storeOptions); } else { - webClientOptions.setTrustStoreOptions((JksOptions) storeOptions); + webClientOptions.setKeyStoreOptions((JksOptions) storeOptions); } } } catch (Exception e) {