public final class

SSLSocketFactoryImpl

extends SSLSocketFactory
java.lang.Object
   ↳ javax.net.SocketFactory
     ↳ javax.net.ssl.SSLSocketFactory
       ↳ sun.security.ssl.SSLSocketFactoryImpl

Class Overview

Implementation of an SSL socket factory. This provides the public hooks to create SSL sockets, using a "high level" programming interface which encapsulates system security policy defaults rather than offering application flexibility. In particular, it uses a configurable authentication context (and the keys held there) rather than offering any flexibility about which keys to use; that context defaults to the process-default context, but may be explicitly specified.

Summary

Public Constructors
SSLSocketFactoryImpl()
Constructor used to instantiate the default factory.
Public Methods
Socket createSocket(String host, int port, InetAddress clientAddress, int clientPort)
Constructs an SSL connection to a named host at a specified port.
Socket createSocket(InetAddress address, int port, InetAddress clientAddress, int clientPort)
Constructs an SSL connection to a server at a specified address and TCP port.
Socket createSocket(InetAddress address, int port)
Constructs an SSL connection to a server at a specified address and TCP port.
Socket createSocket(Socket s, String host, int port, boolean autoClose)
Returns a socket layered over an existing socket to a ServerSocket on the named host, at the given port.
Socket createSocket(String host, int port)
Constructs an SSL connection to a named host at a specified port.
Socket createSocket()
Creates an unconnected socket.
String[] getDefaultCipherSuites()
Returns the subset of the supported 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.
[Expand]
Inherited Methods
From class javax.net.ssl.SSLSocketFactory
From class javax.net.SocketFactory
From class java.lang.Object

Public Constructors

public SSLSocketFactoryImpl ()

Constructor used to instantiate the default factory. This method is only called if the old "ssl.SocketFactory.provider" property in the java.security file is set.

Throws
Exception

Public Methods

public Socket createSocket (String host, int port, InetAddress clientAddress, int clientPort)

Constructs an SSL connection to a named host at a specified port. This acts as the SSL client, and may authenticate itself or rejoin existing SSL sessions allowed by the authentication context which has been configured. The socket will also bind() to the local address and port supplied.

Parameters
host the server host
port the server port
clientAddress the local address the socket is bound to
clientPort the local port the socket is bound to
Returns
  • the Socket
Throws
IOException

public Socket createSocket (InetAddress address, int port, InetAddress clientAddress, int clientPort)

Constructs an SSL connection to a server at a specified address and TCP port. This acts as the SSL client, and may authenticate itself or rejoin existing SSL sessions allowed by the authentication context which has been configured. The socket will also bind() to the local address and port supplied.

Parameters
address the server network address
port the server port
clientAddress the client network address
clientPort the client port
Returns
  • the Socket
Throws
IOException

public Socket createSocket (InetAddress address, int port)

Constructs an SSL connection to a server at a specified address and TCP port. This acts as the SSL client, and may authenticate itself or rejoin existing SSL sessions allowed by the authentication context which has been configured.

Parameters
address the server's host
port its port
Returns
  • the Socket
Throws
IOException

public Socket createSocket (Socket s, String host, int port, boolean autoClose)

Returns a socket layered over an existing socket to a ServerSocket on the named host, at the given port. This constructor can be used when tunneling SSL through a proxy. The host and port refer to the logical destination server. This socket is configured using the socket options established for this factory.

Parameters
s the existing socket
host the server host
port the server port
autoClose close the underlying socket when this socket is closed
Returns
  • a socket connected to the specified host and port
Throws
IOException if the connection can't be established
UnknownHostException if the host is not known

public Socket createSocket (String host, int port)

Constructs an SSL connection to a named host at a specified port. This acts as the SSL client, and may authenticate itself or rejoin existing SSL sessions allowed by the authentication context which has been configured.

Parameters
host name of the host with which to connect
port number of the server's port
Returns
  • the Socket

public Socket createSocket ()

Creates an unconnected socket.

Returns
  • the unconnected socket

public String[] getDefaultCipherSuites ()

Returns the subset of the supported cipher suites which are enabled by default. These cipher suites all provide a minimum quality of service whereby the server authenticates itself (preventing person-in-the-middle attacks) and where traffic is encrypted to provide confidentiality.

Returns
  • array of the cipher suites enabled by default

public String[] getSupportedCipherSuites ()

Returns the names of the cipher suites which could be enabled for use on an SSL connection. Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not support the mutual authentication of servers and clients, or which do not protect data confidentiality. Servers may also need certain kinds of certificates to use certain cipher suites.

Returns
  • an array of cipher suite names