Created an in-memory UnboundID LDAP server. The server listens on an unencrypted port and a TLS port. I can bind to it with LDAP on the first port, and LDAPS on the second port. However, I cannot connect to it using startTLS. The error is:
LDAPException(resultCode=53 (unwilling to perform), errorMessage='No extended operation handler is defined for extended request OID '1.3.6.1.4.1.1466.20037'.', diagnosticMessage='No extended operation handler is defined for extended request OID '1.3.6.1.4.1.1466.20037'.')
Here is how the server is configured:
try {
InMemoryListenerConfig ldapsConfig = InMemoryListenerConfig.createLDAPSConfig("ldaps",
LDAPS_PORT,
getServerSSLContext().getServerSocketFactory());
InMemoryListenerConfig ldapConfig = InMemoryListenerConfig.createLDAPConfig("ldap",
LDAP_PORT);
InMemoryDirectoryServerConfig serverConfig serverConfig = new InMemoryDirectoryServerConfig(BASE_DN);
serverConfig.addAdditionalBindCredentials(BIND_RDN, BIND_PASSWORD);
serverConfig.setListenerConfigs(ldapConfig, ldapsConfig);
server = new InMemoryDirectoryServer(serverConfig);
server.startListening();
} catch (LDAPException e) {
fail(e.getMessage());
}
The message tells me I need to add some kind of handler to the server, but I cannot find an example in the docs I've skimmed.