|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
public abstract class AbstractTLSSocketFactory
Provides common implementation for TLSSocketFactory.
| Field Summary | |
|---|---|
protected String[] |
cipherSuites
Enabled cipher suites. |
static String |
DEFAULT_PROTOCOL
Default SSL protocol, value is "TLS". |
protected SSLSocketFactory |
factory
SSLSocketFactory used for creating SSL sockets. |
protected String[] |
protocols
Enabled protocol versions. |
| Constructor Summary | |
|---|---|
AbstractTLSSocketFactory()
|
|
| Method Summary | |
|---|---|
Socket |
createSocket()
This creates an unconnected socket. |
Socket |
createSocket(InetAddress host,
int port)
This creates a socket and connects it to the specified port number at the specified address. |
Socket |
createSocket(InetAddress address,
int port,
InetAddress localAddress,
int localPort)
This creates a socket and connect it to the specified port number at the specified address. |
Socket |
createSocket(Socket s,
String host,
int port,
boolean autoClose)
This returns a socket layered over an existing socket connected to the named host, at the given port. |
Socket |
createSocket(String host,
int port)
This creates a socket and connects it to the specified port number at the specified address. |
Socket |
createSocket(String host,
int port,
InetAddress localHost,
int localPort)
This creates a socket and connect it to the specified port number at the specified address. |
String[] |
getDefaultCipherSuites()
This returns the list of cipher suites which are enabled by default. |
String[] |
getEnabledCipherSuites()
This returns the names of the SSL cipher suites which are currently enabled for use on sockets created by this factory. |
String[] |
getEnabledProtocols()
This returns the names of the protocol versions which are currently enabled for use on sockets created by this factory. |
SSLSocketFactory |
getFactory()
This returns the underlying SSLSocketFactory that this class
uses for creating SSL Sockets. |
String[] |
getSupportedCipherSuites()
This returns the names of the cipher suites which could be enabled for use on an SSL connection. |
abstract void |
initialize()
Prepares this socket factory for use. |
protected SSLSocket |
initSSLSocket(SSLSocket s)
Initializes the supplied socket for use. |
void |
setEnabledCipherSuites(String[] s)
Sets the cipher suites enabled for use on sockets created by this factory. |
void |
setEnabledProtocols(String[] s)
Sets the protocol versions enabled for use on sockets created by this factory. |
| Methods inherited from class javax.net.ssl.SSLSocketFactory |
|---|
getDefault |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PROTOCOL
protected SSLSocketFactory factory
protected String[] cipherSuites
protected String[] protocols
| Constructor Detail |
|---|
public AbstractTLSSocketFactory()
| Method Detail |
|---|
public abstract void initialize()
throws GeneralSecurityException
GeneralSecurityException - if the factory cannot be initializedpublic SSLSocketFactory getFactory()
SSLSocketFactory that this class
uses for creating SSL Sockets.
SSLSocketFactorypublic String[] getEnabledCipherSuites()
String[] of cipher suitespublic String[] getEnabledProtocols()
String[] of protocolspublic void setEnabledCipherSuites(String[] s)
SSLSocket.setEnabledCipherSuites(String[]).
s - String[] of cipher suitespublic void setEnabledProtocols(String[] s)
SSLSocket.setEnabledProtocols(String[]).
s - String[] of cipher suitesprotected SSLSocket initSSLSocket(SSLSocket s)
s - SSLSocket to initialize
SSLSocket
public Socket createSocket(Socket s,
String host,
int port,
boolean autoClose)
throws IOException
createSocket in class SSLSocketFactorys - Socket existing sockethost - String server hostnameport - int server portautoClose - boolean close the underlying socket when
this socket is closed
Socket - connected to the specified host and port
IOException - if an I/O error occurs when creating the socket
public Socket createSocket()
throws IOException
createSocket in class SocketFactorySocket - unconnected socket
IOException - if an I/O error occurs when creating the socket
public Socket createSocket(InetAddress host,
int port)
throws IOException
createSocket in class SocketFactoryhost - InetAddress server hostnameport - int server port
Socket - connected to the specified host and port
IOException - if an I/O error occurs when creating the socket
public Socket createSocket(InetAddress address,
int port,
InetAddress localAddress,
int localPort)
throws IOException
createSocket in class SocketFactoryaddress - InetAddress server hostnameport - int server portlocalAddress - InetAddress client hostnamelocalPort - int client port
Socket - connected to the specified host and port
IOException - if an I/O error occurs when creating the socket
public Socket createSocket(String host,
int port)
throws IOException
createSocket in class SocketFactoryhost - String server hostnameport - int server port
Socket - connected to the specified host and port
IOException - if an I/O error occurs when creating the socket
public Socket createSocket(String host,
int port,
InetAddress localHost,
int localPort)
throws IOException
createSocket in class SocketFactoryhost - String server hostnameport - int server portlocalHost - InetAddress client hostnamelocalPort - int client port
Socket - connected to the specified host and port
IOException - if an I/O error occurs when creating the socketpublic String[] getDefaultCipherSuites()
getDefaultCipherSuites in class SSLSocketFactoryString[] - array of the cipher suitespublic String[] getSupportedCipherSuites()
getSupportedCipherSuites in class SSLSocketFactoryString[] - array of the cipher suites
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||