diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientBuilderImpl.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientBuilderImpl.java index 12e4381f7088d4..db30075de5cffe 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientBuilderImpl.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientBuilderImpl.java @@ -39,6 +39,7 @@ import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpVersion; import io.vertx.core.net.JksOptions; +import io.vertx.core.net.PfxOptions; import io.vertx.core.net.ProxyOptions; public class ClientBuilderImpl extends ClientBuilder { @@ -227,16 +228,37 @@ public ClientImpl build() { if (keyStore != null || trustStore != null) { options = options.setSsl(true); if (keyStore != null) { - JksOptions jks = new JksOptions(); - jks.setValue(keyStore); - jks.setPassword(new String(keystorePassword)); - options = options.setKeyStoreOptions(jks); + String keyStoreType = this.keyStore.getType(); + if ("PKCS12".equals(keyStoreType)) { + PfxOptions pks = new PfxOptions(); + pks.setValue(keyStore); + pks.setPassword(new String(keystorePassword)); + options = options.setKeyCertOptions(pks); + } else if ("JKS".equals(keyStoreType)) { + JksOptions jks = new JksOptions(); + jks.setValue(keyStore); + jks.setPassword(new String(keystorePassword)); + options = options.setKeyCertOptions(jks); + } else { + throw new IllegalStateException("Unsupported key store type " + keyStoreType); + } + } if (trustStore != null) { - JksOptions jks = new JksOptions(); - jks.setValue(trustStore); - jks.setPassword(new String(effectiveTrustStorePassword)); - options.setTrustStoreOptions(jks); + String trustStoreType = this.trustStore.getType(); + if ("PKCS12".equals(trustStoreType)) { + PfxOptions pks = new PfxOptions(); + pks.setValue(trustStore); + pks.setPassword(new String(effectiveTrustStorePassword)); + } else if ("JKS".equals(trustStoreType)) { + JksOptions jks = new JksOptions(); + jks.setValue(trustStore); + jks.setPassword(new String(effectiveTrustStorePassword)); + options.setTrustOptions(jks); + } else { + throw new IllegalStateException("Unsupported trust store type " + trustStoreType); + } + } }