All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.security.ssl.SSLServerSocket

java.lang.Object
   |
   +----java.net.ServerSocket
           |
           +----sun.security.ssl.SSLServerSocket

public final class SSLServerSocket
extends ServerSocket
This class provides a simple way for servers to support conventional use of the Secure Sockets Layer (SSL). Application code uses an SSLServerSocket exactly like it uses a regular TCP ServerSocket; the difference is that the connections established are secured using SSL.

System security defaults prevent server sockets from accepting connections if they the authentication context has not been given a certificate chain and its matching private key. If the clients of your application support "anonymous" cipher suites, you may be able to configure a server socket to accept those suites.


Notes:

See Also:
SSLSocket

Constructor Index

 o SSLServerSocket(int)
Create an SSL server socket on a port, using the default authentication context.
 o SSLServerSocket(int, AuthContext)
Create an SSL server socket on a port, using a non-default authentication context.
 o SSLServerSocket(int, int)
Create an SSL server socket on a port, using the default authentication context and a specified backlog of connections.
 o SSLServerSocket(int, int, AuthContext)
Create an SSL server socket on a port, using a non-default authentication context and a specified connection backlog.

Method Index

 o accept()
Accept a new SSL connection.
 o getEnabledCipherSuites()
Returns the list of cipher suites which are currently enabled for use by newly accepted connections.
 o setEnabledCipherSuites(String[])
Controls which particular SSL cipher suites are enabled for use by accepted connections.
 o setNeedClientAuth(boolean)
Controls whether the connections which are accepted must include client authentication.
 o toString()
Provides a brief description of this SSL socket.

Constructors

 o SSLServerSocket
  public SSLServerSocket(int port) throws IOException
Create an SSL server socket on a port, using the default authentication context. The connection backlog defaults to fifty connections queued up before the system starts to reject new connection requests.

Parameters:
port - the port on which to listen
 o SSLServerSocket
  public SSLServerSocket(int port,
                         int backlog) throws IOException
Create an SSL server socket on a port, using the default authentication context and a specified backlog of connections.

Parameters:
port - the port on which to listen
backlog - how many connections may be pending before the system should start rejecting new requests
 o SSLServerSocket
  public SSLServerSocket(int port,
                         AuthContext context) throws IOException
Create an SSL server socket on a port, using a non-default authentication context. The connection backlog defaults to fifty connections queued up before the system starts to reject new connection requests.

Parameters:
port - the port on which to listen
context - authentication context for this server
 o SSLServerSocket
  public SSLServerSocket(int port,
                         int backlog,
                         AuthContext context) throws IOException, SSLException
Create an SSL server socket on a port, using a non-default authentication context and a specified connection backlog.

Parameters:
port - the port on which to listen
backlog - how many connections may be pending before the system should start rejecting new requests
context - authentication context for this server

Methods

 o getEnabledCipherSuites
  public String[] getEnabledCipherSuites()
Returns the list of cipher suites which are currently enabled for use by newly accepted connections.

See Also:
getSupportedCipherSuites, getDefaultCipherSuites, setEnabledCipherSuites
 o setEnabledCipherSuites
  public void setEnabledCipherSuites(String suites[])
Controls which particular SSL cipher suites are enabled for use by accepted connections. The cipher suites must have been listed by SSLSocket.getSupportedCipherSuites() as being supported. Suites which require authentication information which is not available in this ServerSocket's authentication context will not be used in any case, even if they are enabled.

Parameters:
suites - Names of all the cipher suites to enable; null means to accept system defaults.
See Also:
getSupportedCipherSuites, getDefaultCipherSuites, getEnabledCipherSuites
 o setNeedClientAuth
  public void setNeedClientAuth(boolean flag)
Controls whether the connections which are accepted must include client authentication. By default, clients do not need to provide authentication information.

 o accept
  public Socket accept() throws IOException
Accept a new SSL connection. This server identifies itself with information provided in the authentication context which was presented during construction.

Overrides:
accept in class ServerSocket
 o toString
  public String toString()
Provides a brief description of this SSL socket.

Overrides:
toString in class ServerSocket

All Packages  Class Hierarchy  This Package  Previous  Next  Index