diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpClientBuilder.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpClientBuilder.java index aea696055b..7338f220a6 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpClientBuilder.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpClientBuilder.java @@ -427,13 +427,11 @@ public class HttpClientBuilder { throw new RuntimeException("Failed to load keystore", e); } } - int size = 10; - if (adapterConfig.getConnectionPoolSize() > 0) - size = adapterConfig.getConnectionPoolSize(); + HttpClientBuilder.HostnameVerificationPolicy policy = HttpClientBuilder.HostnameVerificationPolicy.WILDCARD; if (adapterConfig.isAllowAnyHostname()) policy = HttpClientBuilder.HostnameVerificationPolicy.ANY; - connectionPoolSize(size); + connectionPoolSize(adapterConfig.getConnectionPoolSize()); hostnameVerification(policy); if (adapterConfig.isDisableTrustManager()) { disableTrustManager(); diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/cloned/HttpClientBuilder.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/cloned/HttpClientBuilder.java index e531024ed2..c3706a62db 100644 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/cloned/HttpClientBuilder.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/cloned/HttpClientBuilder.java @@ -359,13 +359,11 @@ public class HttpClientBuilder { throw new RuntimeException("Failed to load keystore", e); } } - int size = 10; - if (adapterConfig.getConnectionPoolSize() > 0) - size = adapterConfig.getConnectionPoolSize(); + HttpClientBuilder.HostnameVerificationPolicy policy = HttpClientBuilder.HostnameVerificationPolicy.WILDCARD; if (adapterConfig.isAllowAnyHostname()) policy = HttpClientBuilder.HostnameVerificationPolicy.ANY; - connectionPoolSize(size); + connectionPoolSize(adapterConfig.getConnectionPoolSize()); hostnameVerification(policy); if (adapterConfig.isDisableTrustManager()) { disableTrustManager();