# SSLServerSocket

public abstract class **SSLServerSocket** extends [ServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html)  
This class extends `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.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`

### Protected Constructor Summary

|---|---|
|   | [SSLServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#SSLServerSocket())() Used only by subclasses. |
|   | [SSLServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#SSLServerSocket(int))(int port) Used only by subclasses. |
|   | [SSLServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#SSLServerSocket(int,%20int))(int port, int backlog) Used only by subclasses. |
|   | [SSLServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#SSLServerSocket(int,%20int,%20java.net.InetAddress))(int port, int backlog, [InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) address) Used only by subclasses. |

### Public Method Summary

|---|---|
| abstract boolean | [getEnableSessionCreation](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnableSessionCreation())() Returns true if new SSL sessions may be established by the sockets which are created from this server socket. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getEnabledCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledCipherSuites())() Returns the list of cipher suites which are currently enabled for use by newly accepted connections. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getEnabledProtocols](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledProtocols())() Returns the names of the protocols which are currently enabled for use by the newly accepted connections. |
| abstract boolean | [getNeedClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getNeedClientAuth())() Returns true if client authentication will be *required* on newly `accept`ed server-mode `SSLSocket`s. |
| [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html) | [getSSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSSLParameters())() Returns the SSLParameters in effect for newly accepted connections. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSupportedCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedCipherSuites())() Returns the names of the cipher suites which could be enabled for use on an SSL connection. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSupportedProtocols](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedProtocols())() Returns the names of the protocols which could be enabled for use. |
| abstract boolean | [getUseClientMode](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getUseClientMode())() Returns true if accepted connections will be in SSL client mode. |
| abstract boolean | [getWantClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getWantClientAuth())() Returns true if client authentication will be *requested* on newly accepted server-mode connections. |
| abstract void | [setEnableSessionCreation](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnableSessionCreation(boolean))(boolean flag) Controls whether new SSL sessions may be established by the sockets which are created from this server socket. |
| abstract void | [setEnabledCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledCipherSuites(java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) suites) Sets the cipher suites enabled for use by accepted connections. |
| abstract void | [setEnabledProtocols](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledProtocols(java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocols) Controls which particular protocols are enabled for use by accepted connections. |
| abstract void | [setNeedClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setNeedClientAuth(boolean))(boolean need) Controls whether `accept`ed server-mode `SSLSockets` will be initially configured to *require* client authentication. |
| void | [setSSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setSSLParameters(javax.net.ssl.SSLParameters))([SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html) params) Applies SSLParameters to newly accepted connections. |
| abstract void | [setUseClientMode](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean))(boolean mode) Controls whether accepted connections are in the (default) SSL server mode, or the SSL client mode. |
| abstract void | [setWantClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setWantClientAuth(boolean))(boolean want) Controls whether `accept`ed server-mode `SSLSockets` will be initially configured to *request* client authentication. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#toString())() Returns the implementation address and implementation port of this socket as a `String`. |

### Inherited Method Summary

From class [java.net.ServerSocket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html)

|---|---|
| [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [accept](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#accept())() Listens for a connection to be made to this socket and accepts it. |
| void | [bind](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#bind(java.net.SocketAddress,%20int))([SocketAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketAddress.html) endpoint, int backlog) Binds the `ServerSocket` to a specific address (IP address and port number). |
| void | [bind](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#bind(java.net.SocketAddress))([SocketAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketAddress.html) endpoint) Binds the `ServerSocket` to a specific address (IP address and port number). |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#close())() Closes this socket. |
| [ServerSocketChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ServerSocketChannel.html) | [getChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getChannel())() Returns the unique `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ServerSocketChannel.html` object associated with this socket, if any. |
| [InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) | [getInetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getInetAddress())() Returns the local address of this server socket. |
| int | [getLocalPort](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getLocalPort())() Returns the port number on which this socket is listening. |
| [SocketAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketAddress.html) | [getLocalSocketAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getLocalSocketAddress())() Returns the address of the endpoint this socket is bound to. |
| synchronized int | [getReceiveBufferSize](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getReceiveBufferSize())() Gets the value of the `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_RCVBUF` option for this `ServerSocket`, that is the proposed buffer size that will be used for Sockets accepted from this `ServerSocket`. |
| boolean | [getReuseAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getReuseAddress())() Tests if `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_REUSEADDR` is enabled. |
| synchronized int | [getSoTimeout](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#getSoTimeout())() Retrieve setting for `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_TIMEOUT`. |
| final void | [implAccept](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#implAccept(java.net.Socket))([Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) s) Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket. |
| boolean | [isBound](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#isBound())() Returns the binding state of the ServerSocket. |
| boolean | [isClosed](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#isClosed())() Returns the closed state of the ServerSocket. |
| void | [setPerformancePreferences](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#setPerformancePreferences(int,%20int,%20int))(int connectionTime, int latency, int bandwidth) Sets performance preferences for this ServerSocket. |
| synchronized void | [setReceiveBufferSize](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#setReceiveBufferSize(int))(int size) Sets a default proposed value for the `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_RCVBUF` option for sockets accepted from this `ServerSocket`. |
| void | [setReuseAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#setReuseAddress(boolean))(boolean on) Enable/disable the `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_REUSEADDR` socket option. |
| synchronized void | [setSoTimeout](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#setSoTimeout(int))(int timeout) Enable/disable `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketOptions.html#SO_TIMEOUT` with the specified timeout, in milliseconds. |
| synchronized static void | [setSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#setSocketFactory(java.net.SocketImplFactory))([SocketImplFactory](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketImplFactory.html) fac) Sets the server socket implementation factory for the application. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ServerSocket.html#toString())() Returns the implementation address and implementation port of this socket as a `String`. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.io.Closeable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html#close())() Closes this stream and releases any system resources associated with it. |

From interface [java.lang.AutoCloseable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html#close())() Closes this resource, relinquishing any underlying resources. |

## Protected Constructors

#### protected
**SSLServerSocket**
()

Used only by subclasses.


Create an unbound TCP server socket using the default authentication
context.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs when creating the socket |
|---|---|

#### protected
**SSLServerSocket**
(int port)

Used only by subclasses.


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 `0` creates a socket on any free port.


If there is a security manager, its `checkListen`
method is called with the `port` argument as its
argument to ensure the operation is allowed. This could result
in a SecurityException.

##### Parameters

| port | the port on which to listen |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs when creating the socket |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkListen` method doesn't allow the operation. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityManager.html#checkListen(int)`

#### protected
**SSLServerSocket**
(int port, int backlog)

Used only by subclasses.


Create a TCP server socket on a port, using the default
authentication context and a specified backlog of connections.


A port number of `0` creates a socket on any free port.


The `backlog` argument is the requested maximum number of
pending connections on the socket. Its exact semantics are implementation
specific. In particular, an implementation may impose a maximum length
or may choose to ignore the parameter altogther. The value provided
should be greater than `0`. If it is less than or equal to
`0`, then an implementation specific default will be used.


If there is a security manager, its `checkListen`
method is called with the `port` argument as its
argument to ensure the operation is allowed. This could result
in a SecurityException.

##### Parameters

| port | the port on which to listen |
| backlog | requested maximum length of the queue of incoming connections. |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs when creating the socket |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkListen` method doesn't allow the operation. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityManager.html#checkListen(int)`

#### protected
**SSLServerSocket**
(int port, int backlog, [InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) address)

Used only by subclasses.


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 `checkListen`
method is called with the `port` argument as its
argument to ensure the operation is allowed. This could result
in a SecurityException.


A port number of `0` creates a socket on any free port.


The `backlog` argument is the requested maximum number of
pending connections on the socket. Its exact semantics are implementation
specific. In particular, an implementation may impose a maximum length
or may choose to ignore the parameter altogther. The value provided
should be greater than `0`. If it is less than or equal to
`0`, then an implementation specific default will be used.


If *address* is null, it will default accepting connections
on any/all local addresses.

##### Parameters

| port | the port on which to listen |
| backlog | requested maximum length of the queue of incoming connections. |
| address | the address of the network interface through which connections will be accepted |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs when creating the socket |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkListen` method doesn't allow the operation. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityManager.html#checkListen(int)`

## Public Methods

#### public abstract boolean
**getEnableSessionCreation**
()

Returns true if new SSL sessions may be established by the
sockets which are created from this server socket.

##### Returns

- true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnableSessionCreation(boolean)`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getEnabledCipherSuites**
()

Returns the list of cipher suites which are currently enabled
for use by newly accepted connections.


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.

##### Returns

- an array of cipher suites enabled

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedCipherSuites()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledCipherSuites(java.lang.String[])`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getEnabledProtocols**
()

Returns the names of the protocols which are currently
enabled for use by the newly accepted connections.

##### Returns

- an array of protocol names

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedProtocols()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledProtocols(java.lang.String[])`

#### public abstract boolean
**getNeedClientAuth**
()

Returns true if client authentication will be *required* on
newly `accept`ed server-mode `SSLSocket`s.


The initial inherited setting may be overridden by calling
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setNeedClientAuth(boolean)` or
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setWantClientAuth(boolean)`.

##### Returns

- true if client authentication is required, or false if no client authentication is desired.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setNeedClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setWantClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getWantClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean)`

#### public [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html)
**getSSLParameters**
()

Returns the SSLParameters in effect for newly accepted connections.
The ciphersuites and protocols of the returned SSLParameters
are always non-null.

##### Returns

- the SSLParameters in effect for newly accepted connections

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setSSLParameters(javax.net.ssl.SSLParameters)`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**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 meet quality of service requirements for those defaults. Such
cipher suites are useful in specialized applications.

##### Returns

- an array of cipher suite names

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledCipherSuites()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledCipherSuites(java.lang.String[])`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getSupportedProtocols**
()

Returns the names of the protocols which could be enabled for use.

##### Returns

- an array of protocol names supported

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledProtocols()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setEnabledProtocols(java.lang.String[])`

#### public abstract boolean
**getUseClientMode**
()

Returns true if accepted connections will be in SSL client mode.

##### Returns

- true if the connection should use SSL client mode.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean)`

#### public abstract boolean
**getWantClientAuth**
()

Returns true if client authentication will be *requested* on
newly accepted server-mode connections.


The initial inherited setting may be overridden by calling
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setNeedClientAuth(boolean)` or
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setWantClientAuth(boolean)`.

##### Returns

- true if client authentication is requested, or false if no client authentication is desired.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setWantClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setNeedClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getNeedClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean)`

#### public abstract void
**setEnableSessionCreation**
(boolean flag)

Controls whether new SSL sessions may be established by the
sockets which are created from this server socket.


`SSLSocket`s returned from `accept()`
inherit this setting.

##### Parameters

| flag | true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnableSessionCreation()`

#### public abstract void
**setEnabledCipherSuites**
([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) suites)

Sets the cipher suites enabled for use by accepted connections.


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` parameter are enabled
for use.


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.


`SSLSocket`s returned from `accept()`
inherit this setting.

##### Parameters

| suites | Names of all the cipher suites to enable |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | when one or more of ciphers named by the parameter is not supported, or when the parameter is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedCipherSuites()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledCipherSuites()`

#### public abstract void
**setEnabledProtocols**
([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocols)

Controls which particular protocols are enabled for use by
accepted connections.


The protocols must have been listed by
getSupportedProtocols() as being supported.
Following a successful call to this method, only protocols listed
in the `protocols` parameter are enabled for use.


`SSLSocket`s returned from `accept()`
inherit this setting.

##### Parameters

| protocols | Names of all the protocols to enable. |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | when one or more of the protocols named by the parameter is not supported or when the protocols parameter is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getEnabledProtocols()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSupportedProtocols()`

#### public abstract void
**setNeedClientAuth**
(boolean need)

Controls whether `accept`ed server-mode
`SSLSockets` will be initially configured to
*require* client authentication.


A socket's client authentication setting is one of the following:

- client authentication required
- client authentication requested
- no client authentication desired


Unlike `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#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 `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setWantClientAuth(boolean)`.


The initial inherited setting may be overridden by calling
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setNeedClientAuth(boolean)` or
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setWantClientAuth(boolean)`.

##### Parameters

| need | set to true if client authentication is required, or false if no client authentication is desired. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getNeedClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setWantClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getWantClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean)`

#### public void
**setSSLParameters**
([SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html) params)

Applies SSLParameters to newly accepted connections.

This means:

- If `params.getCipherSuites()` is non-null, `setEnabledCipherSuites()` is called with that value.
- If `params.getProtocols()` is non-null, `setEnabledProtocols()` is called with that value.
- If `params.getNeedClientAuth()` or `params.getWantClientAuth()` return `true`, `setNeedClientAuth(true)` and `setWantClientAuth(true)` are called, respectively; otherwise `setWantClientAuth(false)` is called.
- If `params.getServerNames()` is non-null, the socket will configure its server names with that value.
- If `params.getSNIMatchers()` is non-null, the socket will configure its SNI matchers with that value.

<br />

##### Parameters

| params | the parameters |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the setEnabledCipherSuites() or the setEnabledProtocols() call fails |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSSLParameters()`

#### public abstract void
**setUseClientMode**
(boolean mode)

Controls whether accepted connections are in the (default) SSL
server mode, or the SSL client mode.


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.


`SSLSocket`s returned from `accept()`
inherit this setting.

##### Parameters

| mode | true if newly accepted connections should use SSL client mode. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getUseClientMode()`

#### public abstract void
**setWantClientAuth**
(boolean want)

Controls whether `accept`ed server-mode
`SSLSockets` will be initially configured to
*request* client authentication.


A socket's client authentication setting is one of the following:

- client authentication required
- client authentication requested
- no client authentication desired


Unlike `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#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 `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setNeedClientAuth(boolean)`.


The initial inherited setting may be overridden by calling
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setNeedClientAuth(boolean)` or
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setWantClientAuth(boolean)`.

##### Parameters

| want | set to true if client authentication is requested, or false if no client authentication is desired. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getWantClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setNeedClientAuth(boolean)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getNeedClientAuth()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setUseClientMode(boolean)`

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Returns the implementation address and implementation port of
this socket as a `String`.


If there is a security manager set, its `checkConnect` method is
called with the local address and `-1` as its arguments to see
if the operation is allowed. If the operation is not allowed,
an `InetAddress` representing the
`https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html#getLoopbackAddress()` address is returned as
the implementation address.

##### Returns

- a string representation of this socket.