public abstract class AbstractTLSSocketFactory extends SSLSocketFactory
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROTOCOL
Default SSL protocol, value is "TLS".
|
protected SSLSocketFactory |
factory
SSLSocketFactory used for creating SSL sockets.
|
protected 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 |
---|---|
Socket |
createSocket()
Creates an unconnected socket.
|
Socket |
createSocket(InetAddress host,
int port)
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)
Creates a socket and connect it to the specified port number at the specified address.
|
Socket |
createSocket(Socket socket,
String host,
int port,
boolean autoClose)
Returns a socket layered over an existing socket connected to the named host, at the given port.
|
Socket |
createSocket(String host,
int port)
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)
Creates a socket and connect it to the specified port number at the specified address.
|
String[] |
getDefaultCipherSuites()
Returns the list of cipher suites which are enabled by default.
|
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.
|
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 SSLSocket |
initSSLSocket(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.
|
createSocket, getDefault
public static final String DEFAULT_PROTOCOL
protected final Logger logger
protected SSLSocketFactory factory
private SslConfig sslConfig
private SocketConfig socketConfig
public abstract void initialize() throws GeneralSecurityException
GeneralSecurityException
- if the factory cannot be initializedpublic SSLSocketFactory getFactory()
public SslConfig getSslConfig()
public void setSslConfig(SslConfig config)
config
- ssl configpublic SocketConfig getSocketConfig()
public void setSocketConfig(SocketConfig config)
config
- socket configprotected SSLSocket initSSLSocket(SSLSocket socket) throws IOException
socket
- SSL socket to initializeIOException
- if an I/O error occurs when initializing the socketpublic Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException
createSocket
in class SSLSocketFactory
socket
- existing sockethost
- server hostnameport
- server portautoClose
- close the underlying socket when this socket is closedIOException
- if an I/O error occurs when creating the socketpublic Socket createSocket() throws IOException
createSocket
in class SocketFactory
IOException
- if an I/O error occurs when creating the socketpublic Socket createSocket(InetAddress host, int port) throws IOException
createSocket
in class SocketFactory
host
- server hostnameport
- server portIOException
- if an I/O error occurs when creating the socketpublic Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
createSocket
in class SocketFactory
address
- server hostnameport
- server portlocalAddress
- client hostnamelocalPort
- client portIOException
- if an I/O error occurs when creating the socketpublic Socket createSocket(String host, int port) throws IOException
createSocket
in class SocketFactory
host
- server hostnameport
- server portIOException
- if an I/O error occurs when creating the socketpublic Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
createSocket
in class SocketFactory
host
- server hostnameport
- server portlocalHost
- client hostnamelocalPort
- client portIOException
- if an I/O error occurs when creating the socketpublic String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class SSLSocketFactory
public String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class SSLSocketFactory
Copyright © 2003-2019 Virginia Tech. All Rights Reserved.