Package javax.net.ssl
Class SSLSocketFactory
java.lang.Object
javax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
- Direct Known Subclasses:
OpenSSLSocketFactoryImpl,SSLSocketFactoryImpl
public abstract class SSLSocketFactory extends SocketFactory
The abstract factory implementation to create
SSLSockets.-
Constructor Summary
Constructors Constructor Description SSLSocketFactory()Creates a newSSLSocketFactory. -
Method Summary
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
-
Constructor Details
-
SSLSocketFactory
public SSLSocketFactory()Creates a newSSLSocketFactory.
-
-
Method Details
-
getDefault
Returns the defaultSSLSocketFactoryinstance. The default is defined by the security property'ssl.SocketFactory.provider'.- Returns:
- the default ssl socket factory instance.
-
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
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 IOExceptionCreates 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.
-