Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Copyright 2007-2009 Sun Microsystems, Inc.
Portions copyright 2011-2016 ForgeRock AS.
Portions copyright 2025 3A Systems, LLC
Portions copyright 2025-2026 3A Systems, LLC
! -->
<adm:managed-object name="ldap-connection-handler"
plural-name="ldap-connection-handlers"
Expand Down Expand Up @@ -80,7 +80,7 @@
<adm:default-behavior>
<adm:defined>
<adm:value>
org.opends.server.protocols.ldap.LDAPConnectionHandler
org.forgerock.opendj.reactive.LDAPConnectionHandler2
</adm:value>
</adm:defined>
</adm:default-behavior>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.opends.server.TestCaseUtils;
import org.forgerock.opendj.server.config.server.LDAPConnectionHandlerCfg;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.ConnectionHandler;
import org.forgerock.opendj.config.server.ConfigException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.Attribute;
Expand Down Expand Up @@ -366,4 +367,38 @@ public void testGoodLDAPConnectionHandlerConfiguration() throws Exception
LDAPConnHandler.applyConfigurationChange(config);
LDAPConnHandler.finalizeConnectionHandler(reasonMsg);
}

/**
* A handler created with {@code dsconfig create-connection-handler --type ldap} and no explicit
* {@code java-class} must run on the same class as the shipped LDAP listeners, not on the legacy
* {@link LDAPConnectionHandler} (issue #1116).
*/
@Test
public void testCreatedHandlerDefaultsToLDAPConnectionHandler2() throws Exception {
final String handlerName = "Default Class LDAP Connection Handler";
final DN handlerDN = DN.valueOf("cn=" + handlerName + ",cn=Connection Handlers,cn=config");
TestCaseUtils.dsconfig(
"create-connection-handler",
"--type", "ldap",
"--handler-name", handlerName,
"--set", "enabled:true",
"--set", "listen-address:127.0.0.1",
"--set", "listen-port:" + TestCaseUtils.findFreePort());
try {
Entry handlerEntry = DirectoryServer.getEntry(handlerDN);
assertEquals(handlerEntry.parseAttribute("ds-cfg-java-class").asString(),
LDAPConnectionHandler2.class.getName());

ConnectionHandler<?> running = null;
for (ConnectionHandler<?> handler : DirectoryServer.getConnectionHandlers()) {
if (handlerDN.equals(handler.getComponentEntryDN())) {
running = handler;
}
}
assertNotNull(running, "the created handler is not registered");
assertEquals(running.getClass(), LDAPConnectionHandler2.class);
} finally {
TestCaseUtils.dsconfig("delete-connection-handler", "--handler-name", handlerName);
}
}
}
Loading