set default ldap connection pooling to plain and ssl (#35763)

* set default ldap connection pooling to plain and ssl

closes #35758
This commit is contained in:
Niko Köbler 2024-12-10 16:05:14 +01:00 committed by GitHub
parent 3fca2f3b7f
commit 2639f3ee43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -175,6 +175,8 @@ The LDAP connection pool configuration is configured using the following system
| `com.sun.jndi.ldap.connect.pool.debug` | A string that indicates the level of debug output to produce. Valid values are "fine" (trace connection creation and removal) and "all" (all debugging information)
|===
By default, connection pooling is enabled for both `plain` and `ssl` protocols.
For more details, see the link:https://docs.oracle.com/javase/jndi/tutorial/ldap/connect/config.html[Java LDAP Connection Pooling Configuration] documentation.
To set any of these properties, you can set the `JAVA_OPTS_APPEND` environment variable:

View File

@ -52,12 +52,17 @@ 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) {