public class SSLSocketFactory extends SSLSocketFactory
SSLSocketFactory to
return a custom TrustManager that unconditionally
accepts certificates presented by a SSL server.
* Copyright 2006 Sans Pareil Technologies, Inc.
| Constructor and Description |
|---|
SSLSocketFactory()
Initialise an new instance of the wrapper factory.
|
| Modifier and Type | Method and Description |
|---|---|
Socket |
createSocket()
Create 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 remote address on
the specified remote port.
|
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 remote host at
the specified remote port.
|
Socket |
createSocket(String host,
int port,
InetAddress localHost,
int localPort)
Creates a socket and connects it to the specified remote host on
the specified remote port.
|
static SocketFactory |
getDefault()
Returns a copy of the environment's default socket factory.
|
String[] |
getDefaultCipherSuites()
Returns the list of cipher suites which are enabled by default.
|
String[] |
getSupportedCipherSuites()
Returns the names of the cipher suites which could be enabled for
use on an SSL connection.
|
createSocketpublic SSLSocketFactory()
RuntimeException - If errors are encountered while
initialising the factory.public static SocketFactory getDefault()
public Socket createSocket() throws IOException
createSocket in class SocketFactoryIOException - If the socket cannot be created.public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException
factory.createSocket in class SSLSocketFactorysocket - The existing socket.host - The server host.port - The server port.autoClose - Close the underlying socket when this socket is
closed.IOException - If errors are encountered while creating the
layered socket.UnknownHostException - If the server host specified is
unknown.public Socket createSocket(InetAddress host, int port) throws IOException
createSocket in class SocketFactoryhost - The server host.port - The server port.IOException - If errors are encountered while creating the
layered socket.public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
createSocket in class SocketFactoryaddress - The server network address.port - The server port.localAddress - The client network address.localPort - The client port.IOException - If errors are encountered while creating the
layered socket.public Socket createSocket(String host, int port) throws IOException
factory.createSocket in class SocketFactoryhost - The server host.port - The server port.IOException - If errors are encountered while creating the
layered socket.UnknownHostException - If the server host specified is
unknown.public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
createSocket in class SocketFactoryhost - The server host.port - The server port.localHost - The local address the socket is bound to.localPort - The local port the socket is bound to.IOException - If errors are encountered while creating the
layered socket.UnknownHostException - If the server host specified is
unknown.public String[] getDefaultCipherSuites()
factory.getDefaultCipherSuites in class SSLSocketFactorypublic String[] getSupportedCipherSuites()
factory.getSupportedCipherSuites in class SSLSocketFactory