我试图通过Windows上的java以编程方式连接到我公司的ldap。但是我最终得到了这个例外。
javax.naming.AuthenticationNotSupportedException: [LDAP: error code 8 - 00002028: LdapErr: DSID-0C09018A, comment: The server requires binds to turn on integrity checking if SSL\TLS are not already active on the connection, data 0, vece ]
这是我的相同代码
public static void main(String[] args) throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://url");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "distinguished_name");
env.put(Context.SECURITY_CREDENTIALS, "password");
// env.put("javax.security.sasl.qop", "auth-conf"); //tried this too but same exception
DirContext ctx = new InitialDirContext(env);
}
尝试使用Google搜索,但得到了与SSL不同的回复。试过他们但没有用。有什么建议吗?