LDAP sur SSL : DAPException: Connection lost waiting for results from
Bonjour,
J'ai cette erreur sous tomcat avec utilisation de lib novell pour LDAP:
LDAP Error : LDAPException: Connection lost waiting for results from 10.30.42.2:636 (91) Connect Error
java.io.EOFException: BERDecoder: decode: EOF in Identifier
C'est curieux car avec à peu près le même code depuis le lancement d'un jar :
import java.io.UnsupportedEncodingException;
import java.security.Security;
import javax.net.ssl.*;
import javax.security.auth.login.FailedLoginException;
import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPException;
import com.novell.ldap.LDAPJSSESecureSocketFactory;
import com.novell.ldap.LDAPSocketFactory;
LDAPSocketFactory ssf;
try {
// Dynamically set JSSE as a security provider
// Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
// Dynamically set the property that JSSE uses to identify
// the keystore that holds trusted root certificates
// System.out.println(System.getProperty("javax.net.s sl.trustStore"));
//System.setProperty("javax.net.ssl.trustStore", path);
// System.out.println(System.getProperty("javax.net.s sl.trustStore"));
ssf = new LDAPJSSESecureSocketFactory();
// Set the socket factory as the default for all future connections
//LDAPConnection.setSocketFactory(ssf);
// Note: the socket factory can also be passed in as a parameter
// to the constructor to set it for this connection only.
LDAPConnection lc = new LDAPConnection(ssf);
// connect to the server
lc.connect(ldapHost,ldapPort);
Tout fonctionne bien. Pourtant mon certificat a bien été importé.
Quelqu'un a une idée ?
Merci