* @param ldapName
* @param tryPasswdHash
*/
private void checkLDAP(String ldapName, byte[] tryPasswdHash) throws ClipsServerException {
Hashtable<String, String> env = new Hashtable<String, String>();
ServConfig sc = manager.find(ServConfig.class, ConfigParametrAbstract.ID_LDAP_URL);
String url = (sc == null) ? "" : sc.getStrvalue();
ServConfig scSSL = manager.find(ServConfig.class, ConfigParametrAbstract.ID_LDAP_USE_SSL);
Boolean ssl = (scSSL == null) ? false : Boolean.parseBoolean(scSSL.getStrvalue());
ServConfig scMask = manager.find(ServConfig.class, ConfigParametrAbstract.ID_LDAP_SEARCH_MASK);
String mask = (scMask == null) ? "$1" : scMask.getStrvalue();
mask = mask.replaceAll("\\$1", "%s");
mask = String.format(mask, ldapName);
ServConfig scType = manager.find(ServConfig.class, ConfigParametrAbstract.ID_LDAP_CRYPTO_SCHEME);
String crypt = (scType == null) ? "simple" : scType.getStrvalue();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_AUTHENTICATION, crypt);
env.put(Context.SECURITY_PRINCIPAL, mask);