Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Anonymous_User Absent Member.
Absent Member.
429 views

LDAP over SSL connection problem ?


Hello,

I got a problem with coding LDAP over SSL. I got the following error
under tomcat :

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

Please what does it mean ? My certificate was add as trusted and out of
tomcat, a jar works great using approximately the same code :

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.ssl.trustStore"));
//System.setProperty("javax.net.ssl.trustStore", path);
//
System.out.println(System.getProperty("javax.net.ssl.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);


Any help would be greatly appreciated..

Regards

FP


--
flatplane
------------------------------------------------------------------------
flatplane's Profile: http://forums.novell.com/member.php?userid=81794
View this thread: http://forums.novell.com/showthread.php?t=405749

Labels (1)
0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: LDAP over SSL connection problem ?

I have added the cert to the default keystore for the Java VM I am using.

This works for me:

public LDAPSSL()
{
LDAPSocketFactory ssf;

ssf = new LDAPJSSESecureSocketFactory();
LDAPConnection lc = new LDAPConnection(ssf);
// connect to the server
String ldapHost = "ldap.yourdomain.com";
int ldapPort = LDAPConnection.DEFAULT_SSL_PORT;
try
{
lc.connect(ldapHost, ldapPort);
System.out.println("Success!");
}
catch (LDAPException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}

public static void main(String[] args)
{
LDAPSSL ldssl = new LDAPSSL();
}


-jim


On 3/25/2010 10:16 AM, flatplane wrote:
>
> Hello,
>
> I got a problem with coding LDAP over SSL. I got the following error
> under tomcat :
>
> 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
>
> Please what does it mean ? My certificate was add as trusted and out of
> tomcat, a jar works great using approximately the same code :
>
> 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.ssl.trustStore"));
> //System.setProperty("javax.net.ssl.trustStore", path);
> //
> System.out.println(System.getProperty("javax.net.ssl.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);
>
>
> Any help would be greatly appreciated..
>
> Regards
>
> FP
>
>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.