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 Details

    • SSLSocketFactory

      public SSLSocketFactory()
      Creates a new SSLSocketFactory.
  • Method Details

    • getDefault

      public static SocketFactory getDefault()
      Returns the default SSLSocketFactory instance. 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 an SSLSocket over 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 - true if socket s should be closed when the created socket is closed, false if the socket s should be left open.
      Returns:
      the creates ssl socket.
      Throws:
      IOException - if creating the socket fails.
      UnknownHostException - if the host is unknown.