Class sun.security.ssl.SSLServerSocket
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.
Notes:
- This API is still a "work in progress". Comments are solicited!
It is not intended to be a complete (or final) API at this time.
- At this time, all SSL server sockets must provide an RSA private
key and certificate chain. Use of other kinds of certificate (such
as ones with Diffie-Hellman keys, or DSS/DSA keys) is not yet supported.
- Similarly, use of "anonymous" SSL modes is not yet supported.
- Servers may not currently request that clients authenticate
themselves. This feature is important and will be provided in a
future release.
- See Also:
- SSLOptions, SSLSocket
-
SSLServerSocket(int, CertChain, Key)
- Create an SSL server socket.
-
SSLServerSocket(int, int, CertChain, Key)
- Create an SSL server socket.
-
accept()
- Accept a new SSL connection.
-
finalize()
- Safely shuts down this SSL connection.
-
toString()
- Provides a brief description of this SSL socket.
SSLServerSocket
public SSLServerSocket(int port,
CertChain certs,
Key priv) throws IOException
- Create an SSL server socket. The server will authenticate
itself using the cert chain and private key passed in. 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
- certs - a chain of certificates for this server
- priv - private key corresponding to chain
SSLServerSocket
public SSLServerSocket(int port,
int backlog,
CertChain certs,
Key priv) throws IOException
- Create an SSL server socket. The server will authenticate
itself using the cert chain and private key passed in. The
maximum connection backlog is assigned as requested.
- Parameters:
- port - the port on which to listen
- backlog - how many connections may be pending before
the system should start rejecting new requests
- certs - a chain of certificates for this server
- priv - private key corresponding to chain
accept
public Socket accept() throws IOException
- Accept a new SSL connection. This server identifies itself with
the certificates and private key provided in the constructor.
- Overrides:
- accept in class ServerSocket
toString
public String toString()
- Provides a brief description of this SSL socket.
- Overrides:
- toString in class ServerSocket
finalize
public void finalize()
- Safely shuts down this SSL connection.
- Overrides:
- finalize in class Object
All Packages Class Hierarchy This Package Previous Next Index