java.lang.Objectjava.net.ServerSocket
javax.net.ssl.SSLServerSocket
All Implemented Interfaces:
Closeable
ServerSocket
s and
provides secure server sockets using protocols such as the Secure
Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.
Instances of this class are generally created using a
SSLServerSocketFactory
. The primary function
of SSLServerSocket
s
is to create SSLSocket
s by accept
ing
connections.
SSLServerSocket
s contain several pieces of state data
which are inherited by the SSLSocket
at
socket creation. These include the enabled cipher
suites and protocols, whether client
authentication is necessary, and whether created sockets should
begin handshaking in client or server mode. The state
inherited by the created SSLSocket
can be
overriden by calling the appropriate methods.
1.4
- David
- BrownellConstructor: |
---|
Create an unbound TCP server socket using the default authentication context.
|
Create a TCP 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.
A port number of
If there is a security manager, its
|
Create a TCP server socket on a port, using the default authentication context and a specified backlog of connections.
A port number of
The
If there is a security manager, its
|
Create a TCP server socket on a port, using the default authentication context and a specified backlog of connections as well as a particular specified network interface. This constructor is used on multihomed hosts, such as those used for firewalls or as routers, to control through which interface a network service is provided.
If there is a security manager, its
A port number of
The If address is null, it will default accepting connections on any/all local addresses.
|
Method from javax.net.ssl.SSLServerSocket Summary: |
---|
getEnableSessionCreation, getEnabledCipherSuites, getEnabledProtocols, getNeedClientAuth, getSSLParameters, getSupportedCipherSuites, getSupportedProtocols, getUseClientMode, getWantClientAuth, setEnableSessionCreation, setEnabledCipherSuites, setEnabledProtocols, setNeedClientAuth, setSSLParameters, setUseClientMode, setWantClientAuth |
Methods from java.net.ServerSocket: |
---|
accept, bind, bind, close, createImpl, getChannel, getImpl, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setBound, setCreated, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSoTimeout, setSocketFactory, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.net.ssl.SSLServerSocket Detail: |
---|
|
If this list has not been explicitly modified, a system-provided default guarantees a minimum quality of service in all enabled cipher suites. There are several reasons why an enabled cipher suite might not actually be used. For example: the server socket might not have appropriate private keys available to it or the cipher suite might be anonymous, precluding the use of client authentication, while the server socket has been told to require that sort of authentication. |
|
accept ed server-mode SSLSocket s.
The initial inherited setting may be overridden by calling SSLSocket#setNeedClientAuth(boolean) or SSLSocket#setWantClientAuth(boolean) . |
|
Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements for those defaults. Such cipher suites are useful in specialized applications. |
|
|
The initial inherited setting may be overridden by calling SSLSocket#setNeedClientAuth(boolean) or SSLSocket#setWantClientAuth(boolean) . |
|
The cipher suites must have been listed by getSupportedCipherSuites()
as being supported. Following a successful call to this method,
only suites listed in the Suites that 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.
|
The protocols must have been listed by
getSupportedProtocols() as being supported.
Following a successful call to this method, only protocols listed
in the
|
accept ed server-mode
SSLSockets will be initially configured to
require client authentication.
A socket's client authentication setting is one of the following: Unlike #setWantClientAuth(boolean) , if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will stop and the connection will be dropped. Calling this method overrides any previous setting made by this method or #setWantClientAuth(boolean) . The initial inherited setting may be overridden by calling SSLSocket#setNeedClientAuth(boolean) or SSLSocket#setWantClientAuth(boolean) . |
This means: |
Servers normally authenticate themselves, and clients are not required to do so. In rare cases, TCP servers need to act in the SSL client mode on newly accepted connections. For example, FTP clients acquire server sockets and listen there for reverse connections from the server. An FTP client would use an SSLServerSocket in "client" mode to accept the reverse connection while the FTP server uses an SSLSocket with "client" mode disabled to initiate the connection. During the resulting handshake, existing SSL sessions may be reused.
|
accept ed server-mode
SSLSockets will be initially configured to
request client authentication.
A socket's client authentication setting is one of the following: Unlike #setNeedClientAuth(boolean) , if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will continue. Calling this method overrides any previous setting made by this method or #setNeedClientAuth(boolean) . The initial inherited setting may be overridden by calling SSLSocket#setNeedClientAuth(boolean) or SSLSocket#setWantClientAuth(boolean) . |