public abstract class AbstractTLSSocketFactory
extends javax.net.ssl.SSLSocketFactory
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PROTOCOL
Default SSL protocol, value is "TLS".
|
protected javax.net.ssl.SSLSocketFactory |
factory
SSLSocketFactory used for creating SSL sockets.
|
protected org.slf4j.Logger |
logger
Logger for this class.
|
private SocketConfig |
socketConfig
Socket configuration options.
|
private SslConfig |
sslConfig
SSL configuration options.
|
| Constructor and Description |
|---|
AbstractTLSSocketFactory() |
| Modifier and Type | Method and Description |
|---|---|
java.net.Socket |
createSocket()
Creates an unconnected socket.
|
java.net.Socket |
createSocket(java.net.InetAddress host,
int port)
Creates a socket and connects it to the specified port number at the specified address.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddress,
int localPort)
Creates a socket and connect it to the specified port number at the specified address.
|
java.net.Socket |
createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose)
Returns a socket layered over an existing socket connected to the named host, at the given port.
|
java.net.Socket |
createSocket(java.lang.String host,
int port)
Creates a socket and connects it to the specified port number at the specified address.
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localHost,
int localPort)
Creates a socket and connect it to the specified port number at the specified address.
|
java.lang.String[] |
getDefaultCipherSuites()
Returns the list of cipher suites which are enabled by default.
|
javax.net.ssl.SSLSocketFactory |
getFactory()
Returns the underlying SSL socket factory that this class uses for creating SSL Sockets.
|
SocketConfig |
getSocketConfig()
Returns the socket configuration used by this socket factory.
|
SslConfig |
getSslConfig()
Returns the SSL configuration used by this socket factory.
|
java.lang.String[] |
getSupportedCipherSuites()
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 javax.net.ssl.SSLSocket |
initSSLSocket(javax.net.ssl.SSLSocket socket)
Initializes the supplied socket for use.
|
void |
setSocketConfig(SocketConfig config)
Sets the socket configuration used by this socket factory.
|
void |
setSslConfig(SslConfig config)
Sets the SSL configuration used by this socket factory.
|
public static final java.lang.String DEFAULT_PROTOCOL
protected final org.slf4j.Logger logger
protected javax.net.ssl.SSLSocketFactory factory
private SslConfig sslConfig
private SocketConfig socketConfig
public abstract void initialize()
throws java.security.GeneralSecurityException
java.security.GeneralSecurityException - if the factory cannot be initializedpublic javax.net.ssl.SSLSocketFactory getFactory()
public SslConfig getSslConfig()
public void setSslConfig(SslConfig config)
config - ssl configpublic SocketConfig getSocketConfig()
public void setSocketConfig(SocketConfig config)
config - socket configprotected javax.net.ssl.SSLSocket initSSLSocket(javax.net.ssl.SSLSocket socket)
throws java.io.IOException
socket - SSL socket to initializejava.io.IOException - if an I/O error occurs when initializing the socketpublic java.net.Socket createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose)
throws java.io.IOException
createSocket in class javax.net.ssl.SSLSocketFactorysocket - existing sockethost - server hostnameport - server portautoClose - close the underlying socket when this socket is closedjava.io.IOException - if an I/O error occurs when creating the socketpublic java.net.Socket createSocket()
throws java.io.IOException
createSocket in class javax.net.SocketFactoryjava.io.IOException - if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.net.InetAddress host,
int port)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - server hostnameport - server portjava.io.IOException - if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddress,
int localPort)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryaddress - server hostnameport - server portlocalAddress - client hostnamelocalPort - client portjava.io.IOException - if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - server hostnameport - server portjava.io.IOException - if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.lang.String host,
int port,
java.net.InetAddress localHost,
int localPort)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - server hostnameport - server portlocalHost - client hostnamelocalPort - client portjava.io.IOException - if an I/O error occurs when creating the socketpublic java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactorypublic java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactory