Package javax.net.ssl
Class SSLSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- Direct Known Subclasses:
OpenSSLSocketFactoryImpl
public abstract class SSLSocketFactory extends SocketFactory
The abstract factory implementation to createSSLSockets.
-
-
Constructor Summary
Constructors Constructor Description SSLSocketFactory()Creates a newSSLSocketFactory.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SocketcreateSocket(Socket s, String host, int port, boolean autoClose)Creates anSSLSocketover the specified socket that is connected to the specified host at the specified port.static SocketFactorygetDefault()Returns the defaultSSLSocketFactoryinstance.abstract String[]getDefaultCipherSuites()Returns the names of the cipher suites that are enabled by default.abstract String[]getSupportedCipherSuites()Returns the names of the cipher suites that are supported and could be enabled for an SSL connection.-
Methods inherited from class javax.net.SocketFactory
createSocket, createSocket, createSocket, createSocket, createSocket, setDefault
-
-
-
-
Method Detail
-
getDefault
public static SocketFactory getDefault()
Returns the defaultSSLSocketFactoryinstance. The default is defined by the security property'ssl.SocketFactory.provider'.- Returns:
- the default ssl socket factory instance.
-
getDefaultCipherSuites
public abstract String[] getDefaultCipherSuites()
Returns the names of the cipher suites that are enabled by default.- Returns:
- the names of the cipher suites that are enabled by default.
-
getSupportedCipherSuites
public abstract String[] getSupportedCipherSuites()
Returns the names of the cipher suites that are supported and could be enabled for an SSL connection.- Returns:
- the names of the cipher suites that are supported.
-
createSocket
public abstract Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException
Creates anSSLSocketover the specified socket that is connected to the specified host at the specified port.- Parameters:
s- the socket.host- the host.port- the port number.autoClose-trueif socketsshould be closed when the created socket is closed,falseif the socketsshould be left open.- Returns:
- the creates ssl socket.
- Throws:
IOException- if creating the socket fails.UnknownHostException- if the host is unknown.
-
-