Package netscape.ldap.factory
Class JSSESocketFactory
- java.lang.Object
-
- 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 theLDAPSocketFactory
interface.- Version:
- 1.0
- See Also:
LDAPSocketFactory
,LDAPConnection(netscape.ldap.LDAPSocketFactory)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JSSESocketFactory()
Default factory constructorJSSESocketFactory(java.lang.String[] suites)
Factory constructorJSSESocketFactory(java.lang.String[] suites, javax.net.ssl.SSLSocketFactory factory)
Factory constructorJSSESocketFactory(javax.net.ssl.SSLSocketFactory factory)
Factory constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.Socket
makeSocket(java.lang.String host, int port)
Creates an SSL socket.java.net.Socket
makeSocket(java.net.Socket s)
Creates an SSL socket layered over an existing socket.
-
-
-
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; ifnull
, 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; ifnull
, use any cipher suites available in the JSSE packagefactory
- 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 interfaceLDAPSocketFactory
- 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- 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 interfaceLDAPTLSSocketFactory
- 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()
-
-