Fix ldap:// with STARTTLS

Closes: #21935
This commit is contained in:
Hynek Mlnarik 2023-09-13 17:29:11 +02:00 committed by Hynek Mlnařík
parent 088abcf1d2
commit 8effe31fdf

View file

@ -192,7 +192,7 @@ public final class LDAPContextManager implements AutoCloseable {
// when using Start TLS, use default socket factory for LDAP client but pass the TrustStore SSL socket factory later // when using Start TLS, use default socket factory for LDAP client but pass the TrustStore SSL socket factory later
// when calling StartTlsResponse.negotiate(trustStoreSSLSocketFactory) // when calling StartTlsResponse.negotiate(trustStoreSSLSocketFactory)
if (LDAPUtil.shouldUseTruststoreSpi(ldapConfig)) { if (!ldapConfig.isStartTls() && LDAPUtil.shouldUseTruststoreSpi(ldapConfig)) {
env.put("java.naming.ldap.factory.socket", "org.keycloak.truststore.SSLSocketFactory"); env.put("java.naming.ldap.factory.socket", "org.keycloak.truststore.SSLSocketFactory");
} }