netscape.ldap.factory
Class JSSESocketFactory

java.lang.Object
  extended by netscape.ldap.factory.JSSESocketFactory
All Implemented Interfaces:
java.io.Serializable, LDAPSocketFactory, LDAPTLSSocketFactory

public class JSSESocketFactory
extends java.lang.Object
implements LDAPTLSSocketFactory, java.io.Serializable

Creates an SSL socket connection to a server, using the JSSE package from Sun. This class implements the LDAPSocketFactory interface.

Version:
1.0
See Also:
LDAPSocketFactory, LDAPConnection.LDAPConnection(netscape.ldap.LDAPSocketFactory), Serialized Form

Field Summary
protected  javax.net.ssl.SSLSocketFactory factory
           
protected  java.lang.String[] suites
           
 
Constructor Summary
JSSESocketFactory()
          Default factory constructor
JSSESocketFactory(javax.net.ssl.SSLSocketFactory factory)
          Factory constructor
JSSESocketFactory(java.lang.String[] suites)
          Factory constructor
JSSESocketFactory(java.lang.String[] suites, javax.net.ssl.SSLSocketFactory factory)
          Factory constructor
 
Method Summary
 java.net.Socket makeSocket(java.net.Socket s)
          Creates an SSL socket layered over an existing socket.
 java.net.Socket makeSocket(java.lang.String host, int port)
          Creates an SSL socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected javax.net.ssl.SSLSocketFactory factory

suites

protected java.lang.String[] suites
Constructor Detail

JSSESocketFactory

public JSSESocketFactory()
Default factory constructor


JSSESocketFactory

public JSSESocketFactory(java.lang.String[] suites)
Factory constructor

Parameters:
suites - Cipher suites to attempt to use with the server; if null, use any cipher suites available in the JSSE package

JSSESocketFactory

public JSSESocketFactory(javax.net.ssl.SSLSocketFactory factory)
Factory constructor

Parameters:
factory - the SSL socketfactory to use

JSSESocketFactory

public JSSESocketFactory(java.lang.String[] suites,
                         javax.net.ssl.SSLSocketFactory factory)
Factory constructor

Parameters:
suites - Cipher suites to attempt to use with the server; if null, use any cipher suites available in the JSSE package
factory - the SSL socketfactory to use
Method Detail

makeSocket

public java.net.Socket makeSocket(java.lang.String host,
                                  int port)
                           throws LDAPException
Creates an SSL socket.

Specified by:
makeSocket in interface LDAPSocketFactory
Parameters:
host - Host name or IP address of SSL server
port - Port numbers of SSL server
Returns:
A socket for an encrypted session
Throws:
LDAPException - on error creating socket
See Also:
LDAPSSLSocketFactory.makeSocket(java.lang.String,int)

makeSocket

public java.net.Socket makeSocket(java.net.Socket s)
                           throws LDAPException
Creates an SSL socket layered over an existing socket. Used for the startTLS implementation (RFC2830).

Specified by:
makeSocket in interface LDAPTLSSocketFactory
Parameters:
s - An existing non-SSL socket
Returns:
A SSL socket layered over the input socket
Throws:
LDAPException - on error creating socket
Since:
LDAPJDK 4.17
See Also:
LDAPConnection.startTLS()