LDAP Classes
Implements Java LDAP

com.novell.ldap
Class LDAPJSSESecureSocketFactory

java.lang.Object
  extended bycom.novell.ldap.LDAPJSSESecureSocketFactory
All Implemented Interfaces:
org.ietf.ldap.LDAPSocketFactory, LDAPSocketFactory

public class LDAPJSSESecureSocketFactory
extends java.lang.Object
implements LDAPSocketFactory, org.ietf.ldap.LDAPSocketFactory

Represents a socket factory that creates secure socket connections to LDAP servers using JSSE technology.

See Also:
LDAPConnection.LDAPConnection(LDAPSocketFactory), LDAPConnection.setSocketFactory(com.novell.ldap.LDAPSocketFactory)

Constructor Summary
LDAPJSSESecureSocketFactory()
          Constructs an LDAPSecureSocketFactory object using the default provider for a JSSE SSLSocketFactory.
LDAPJSSESecureSocketFactory(javax.net.ssl.SSLSocketFactory factory)
          Constructs an LDAPSocketFactory object using the SSLSocketFactory specified.
 
Method Summary
 java.net.Socket createSocket(java.lang.String host, int port)
          Returns the socket connected to the LDAP server with the specified host name and port number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPJSSESecureSocketFactory

public LDAPJSSESecureSocketFactory()
Constructs an LDAPSecureSocketFactory object using the default provider for a JSSE SSLSocketFactory.

Setting the keystore for the default provider is specific to the provider implementation. For Sun's JSSE provider, the property javax.net.ssl.truststore should be set to the path of a keystore that holds the trusted root certificate of the directory server.

For information on creating keystores see the keytool documentation on Java 2, security tools.


LDAPJSSESecureSocketFactory

public LDAPJSSESecureSocketFactory(javax.net.ssl.SSLSocketFactory factory)
Constructs an LDAPSocketFactory object using the SSLSocketFactory specified. For information on using the the SSLSocketFactory, see also javax.net.ssl.SSLSocketFactory

Method Detail

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Returns the socket connected to the LDAP server with the specified host name and port number.

The secure connection is established to the server when this call returns. This method is called by the constructor of LDAPConnection

Specified by:
createSocket in interface LDAPSocketFactory
Parameters:
host - The host name or a dotted string representing the IP address of the LDAP server to which you want to establish a connection.

port - The port number on the specified LDAP server that you want to use for this connection. The default LDAP port for SSL connections is 636.
Returns:
A socket to the LDAP server using the specific host name and port number.
Throws:
java.io.IOException - A socket to the specified host and port could not be created.
java.net.UnknownHostException - The specified host could not be found.

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000