netscape.ldap.factory
Class JSSESocketFactory
java.lang.Object
|
+--netscape.ldap.factory.JSSESocketFactory
- All Implemented Interfaces:
- LDAPSocketFactory, LDAPTLSSocketFactory, java.io.Serializable
- 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.
- 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(java.lang.String[] suites)
Factory constructor that uses the default JSSE SSLSocketFactory |
JSSESocketFactory(java.lang.String[] suites,
javax.net.ssl.SSLSocketFactory factory)
Factory constructor that provides an explicit SSLSocketFactory. |
|
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 |
suites
protected java.lang.String[] suites
factory
protected javax.net.ssl.SSLSocketFactory factory
JSSESocketFactory
public JSSESocketFactory()
- Default factory constructor
JSSESocketFactory
public JSSESocketFactory(java.lang.String[] suites)
- Factory constructor that uses the default JSSE SSLSocketFactory
- 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(java.lang.String[] suites,
javax.net.ssl.SSLSocketFactory factory)
- Factory constructor that provides an explicit SSLSocketFactory.
- Parameters:
suites - Cipher suites to attempt to use with the server;
if null, use any cipher suites available in the
JSSE packagefactory - the specific SSL server socket factory to use
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 serverport - Port numbers of SSL server- Returns:
- A socket for an encrypted session
- Throws:
LDAPException - on error creating socket
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