@SuppressWarnings("JdkObsolete")
    private static Hashtable<String, String> getLdapDirectoryContextSettings(final String bindDn, final String bindCredential, final String url) {
        val env = new Hashtable<String, String>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, url.trim());
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, bindDn);
        env.put(Context.SECURITY_CREDENTIALS, bindCredential);
        env.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(TIMEOUT));
        return env;
    }
Validate endpoint.

@param url            the url
@param bindDn         the bind dn
@param bindCredential the bind credential
@param baseDn         the base dn
@param searchFilter   the search filter
@param userPassword   the user password
@param userAttributes the user attributes
@return true/false
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/util/ValidateLdapConnectionCommand.java