mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
Setting protocol when initializing the LDAP provider
Closes #35758 Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
parent
782135684c
commit
45a6b5c657
@ -83,6 +83,7 @@ public class LDAPStorageProviderFactory implements UserStorageProviderFactory<LD
|
||||
|
||||
private static final Logger logger = Logger.getLogger(LDAPStorageProviderFactory.class);
|
||||
public static final String PROVIDER_NAME = LDAPConstants.LDAP_PROVIDER;
|
||||
private static final String LDAP_CONNECTION_POOL_PROTOCOL = "com.sun.jndi.ldap.connect.pool.protocol";
|
||||
|
||||
private LDAPIdentityStoreRegistry ldapStoreRegistry;
|
||||
|
||||
@ -313,6 +314,10 @@ public class LDAPStorageProviderFactory implements UserStorageProviderFactory<LD
|
||||
|
||||
@Override
|
||||
public void init(Config.Scope config) {
|
||||
// set connection pooling for plain and tls protocols by default
|
||||
if (System.getProperty(LDAP_CONNECTION_POOL_PROTOCOL) == null) {
|
||||
System.setProperty(LDAP_CONNECTION_POOL_PROTOCOL, "plain ssl");
|
||||
}
|
||||
this.ldapStoreRegistry = new LDAPIdentityStoreRegistry();
|
||||
}
|
||||
|
||||
|
||||
@ -52,17 +52,12 @@ import io.quarkus.runtime.annotations.QuarkusMain;
|
||||
public class KeycloakMain implements QuarkusApplication {
|
||||
|
||||
private static final String INFINISPAN_VIRTUAL_THREADS_PROP = "org.infinispan.threads.virtual";
|
||||
private static final String LDAP_CONNECTION_POOL_PROTOCOL = "com.sun.jndi.ldap.connect.pool.protocol";
|
||||
|
||||
static {
|
||||
// enable Infinispan and JGroups virtual threads by default
|
||||
if (System.getProperty(INFINISPAN_VIRTUAL_THREADS_PROP) == null) {
|
||||
System.setProperty(INFINISPAN_VIRTUAL_THREADS_PROP, "true");
|
||||
}
|
||||
// set connection pooling for plain and tls protocols by default
|
||||
if (System.getProperty(LDAP_CONNECTION_POOL_PROTOCOL) == null) {
|
||||
System.setProperty(LDAP_CONNECTION_POOL_PROTOCOL, "plain ssl");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user