# SSLParameters

public class **SSLParameters** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
Encapsulates parameters for an SSL/TLS connection. The parameters
are the list of ciphersuites to be accepted in an SSL/TLS handshake,
the list of protocols to be allowed, the endpoint identification
algorithm during SSL/TLS handshaking, the Server Name Indication (SNI),
the algorithm constraints and whether SSL/TLS servers should request
or require client authentication, etc.


SSLParameters can be created via the constructors in this class.
Objects can also be obtained using the `getSSLParameters()`
methods in
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#getSSLParameters()` and
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#getSSLParameters()` and
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html#getSSLParameters()` or the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getDefaultSSLParameters()` and
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getSupportedSSLParameters()`
methods in `SSLContext`.


SSLParameters can be applied to a connection via the methods
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html#setSSLParameters(javax.net.ssl.SSLParameters)` and
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocket.html#setSSLParameters(javax.net.ssl.SSLParameters)`
and `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html#setSSLParameters(javax.net.ssl.SSLParameters)`.

##### See Also

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

### Public Constructor Summary

|---|---|
|   | [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#SSLParameters())() Constructs SSLParameters. |
|   | [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#SSLParameters(java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) cipherSuites) Constructs SSLParameters from the specified array of ciphersuites. |
|   | [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#SSLParameters(java.lang.String[],%20java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) cipherSuites, [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocols) Constructs SSLParameters from the specified array of ciphersuites and protocols. |

### Public Method Summary

|---|---|
| [AlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmConstraints.html) | [getAlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getAlgorithmConstraints())() Returns the cryptographic algorithm constraints. |
| [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getCipherSuites())() Returns a copy of the array of ciphersuites or null if none have been set. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getEndpointIdentificationAlgorithm](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getEndpointIdentificationAlgorithm())() Gets the endpoint identification algorithm. |
| boolean | [getNeedClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getNeedClientAuth())() Returns whether client authentication should be required. |
| [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getProtocols](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getProtocols())() Returns a copy of the array of protocols or null if none have been set. |
| final [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<[SNIMatcher](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html)\> | [getSNIMatchers](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getSNIMatchers())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` containing all `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s of the Server Name Indication (SNI) parameter, or null if none has been set. |
| final [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[SNIServerName](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html)\> | [getServerNames](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getServerNames())() Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html` containing all `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s of the Server Name Indication (SNI) parameter, or null if none has been set. |
| final boolean | [getUseCipherSuitesOrder](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getUseCipherSuitesOrder())() Returns whether the local cipher suites preference should be honored. |
| boolean | [getWantClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getWantClientAuth())() Returns whether client authentication should be requested. |
| void | [setAlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setAlgorithmConstraints(java.security.AlgorithmConstraints))([AlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmConstraints.html) constraints) Sets the cryptographic algorithm constraints, which will be used in addition to any configured by the runtime environment. |
| void | [setCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setCipherSuites(java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) cipherSuites) Sets the array of ciphersuites. |
| void | [setEndpointIdentificationAlgorithm](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setEndpointIdentificationAlgorithm(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) algorithm) Sets the endpoint identification algorithm. |
| void | [setNeedClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setNeedClientAuth(boolean))(boolean needClientAuth) Sets whether client authentication should be required. |
| void | [setProtocols](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setProtocols(java.lang.String[]))([String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocols) Sets the array of protocols. |
| final void | [setSNIMatchers](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setSNIMatchers(java.util.Collection<javax.net.ssl.SNIMatcher>))([Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<[SNIMatcher](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html)\> matchers) Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s of the Server Name Indication (SNI) parameter. |
| final void | [setServerNames](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setServerNames(java.util.List<javax.net.ssl.SNIServerName>))([List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[SNIServerName](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html)\> serverNames) Sets the desired `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s of the Server Name Indication (SNI) parameter. |
| final void | [setUseCipherSuitesOrder](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setUseCipherSuitesOrder(boolean))(boolean honorOrder) Sets whether the local cipher suites preference should be honored. |
| void | [setWantClientAuth](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setWantClientAuth(boolean))(boolean wantClientAuth) Sets whether client authentication should be requested. |

### Inherited Method Summary

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. |

## Public Constructors

#### public
**SSLParameters**
()

Constructs SSLParameters.


The values of cipherSuites, protocols, cryptographic algorithm
constraints, endpoint identification algorithm, server names and
server name matchers are set to `null`, useCipherSuitesOrder,
wantClientAuth and needClientAuth are set to `false`.

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

Constructs SSLParameters from the specified array of ciphersuites.


Calling this constructor is equivalent to calling the no-args
constructor followed by
`setCipherSuites(cipherSuites);`.

##### Parameters

| cipherSuites | the array of ciphersuites (or null) |
|---|---|

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

Constructs SSLParameters from the specified array of ciphersuites
and protocols.


Calling this constructor is equivalent to calling the no-args
constructor followed by
`setCipherSuites(cipherSuites); setProtocols(protocols);`.

##### Parameters

| cipherSuites | the array of ciphersuites (or null) |
| protocols | the array of protocols (or null) |
|---|---|

## Public Methods

#### public [AlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmConstraints.html)
**getAlgorithmConstraints**
()

Returns the cryptographic algorithm constraints.

##### Returns

- the cryptographic algorithm constraints, or null if the constraints have not been set

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setAlgorithmConstraints(java.security.AlgorithmConstraints)`

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

Returns a copy of the array of ciphersuites or null if none
have been set.

##### Returns

- a copy of the array of ciphersuites or null if none have been set.

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

Gets the endpoint identification algorithm.

##### Returns

- the endpoint identification algorithm, or null if none has been set.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/X509ExtendedTrustManager.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setEndpointIdentificationAlgorithm(java.lang.String)`

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

Returns whether client authentication should be required.

##### Returns

- whether client authentication should be required.

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

Returns a copy of the array of protocols or null if none
have been set.

##### Returns

- a copy of the array of protocols or null if none have been set.

#### public final [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<[SNIMatcher](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html)\>
**getSNIMatchers**
()

Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` containing all `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s of the
Server Name Indication (SNI) parameter, or null if none has been set.


This method is only useful to `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`s or `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html`s
operating in server mode.


For better interoperability, providers generally will not define
default matchers so that by default servers will ignore the SNI
extension and continue the handshake.

##### Returns

- null or an immutable collection of non-null `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setSNIMatchers(java.util.Collection<javax.net.ssl.SNIMatcher>)`

#### public final [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[SNIServerName](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html)\>
**getServerNames**
()

Returns a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html` containing all `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s of the
Server Name Indication (SNI) parameter, or null if none has been set.


This method is only useful to `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`s or `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html`s
operating in client mode.


For SSL/TLS connections, the underlying SSL/TLS provider
may specify a default value for a certain server name type. In
client mode, it is recommended that, by default, providers should
include the server name indication whenever the server can be located
by a supported server name type.


It is recommended that providers initialize default Server Name
Indications when creating `SSLSocket`/`SSLEngine`s.
In the following examples, the server name could be represented by an
instance of `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIHostName.html` which has been initialized with the
hostname "www.example.com" and type
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/StandardConstants.html#SNI_HOST_NAME`.

```
     Socket socket =
         sslSocketFactory.createSocket("www.example.com", 443);
 
```
or

```
     SSLEngine engine =
         sslContext.createSSLEngine("www.example.com", 443);
 
```

<br />

##### Returns

- null or an immutable list of non-null `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#setServerNames(java.util.List<javax.net.ssl.SNIServerName>)`

#### public final boolean
**getUseCipherSuitesOrder**
()

Returns whether the local cipher suites preference should be honored.

##### Returns

- whether local cipher suites order in `#getCipherSuites` should be honored during SSL/TLS handshaking.

##### See Also

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

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

Returns whether client authentication should be requested.

##### Returns

- whether client authentication should be requested.

#### public void
**setAlgorithmConstraints**
([AlgorithmConstraints](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmConstraints.html) constraints)

Sets the cryptographic algorithm constraints, which will be used
in addition to any configured by the runtime environment.


If the `constraints` parameter is non-null, every
cryptographic algorithm, key and algorithm parameters used in the
SSL/TLS handshake must be permitted by the constraints.

##### Parameters

| constraints | the algorithm constraints (or null) |
|---|---|

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

Sets the array of ciphersuites.

##### Parameters

| cipherSuites | the array of ciphersuites (or null) |
|---|---|

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

Sets the endpoint identification algorithm.


If the `algorithm` parameter is non-null or non-empty, the
endpoint identification/verification procedures must be handled during
SSL/TLS handshaking. This is to prevent man-in-the-middle attacks.

##### Parameters

| algorithm | The standard string name of the endpoint identification algorithm (or null). See Appendix A in the [Java Cryptography Architecture API Specification \& Reference](https://developers.google.com/j2objc/javadoc/jre/openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA) for information about standard algorithm names. |
|---|---|

##### See Also

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

#### public void
**setNeedClientAuth**
(boolean needClientAuth)

Sets whether client authentication should be required. Calling
this method clears the `wantClientAuth` flag.

##### Parameters

| needClientAuth | whether client authentication should be required |
|---|---|

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

Sets the array of protocols.

##### Parameters

| protocols | the array of protocols (or null) |
|---|---|

#### public final void
**setSNIMatchers**
([Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<[SNIMatcher](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html)\> matchers)

Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s of the Server Name Indication (SNI)
parameter.


This method is only useful to `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`s or `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html`s
operating in server mode.


Note that the `matchers` collection is cloned to protect
against subsequent modification.

##### Parameters

| matchers | the collection of `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`s (or null) |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if the `matchers` contains `null` element |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the `matchers` contains more than one name of the same name type |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIMatcher.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html#getSNIMatchers()`

#### public final void
**setServerNames**
([List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[SNIServerName](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html)\> serverNames)

Sets the desired `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s of the Server Name
Indication (SNI) parameter.


This method is only useful to `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`s or `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html`s
operating in client mode.


Note that the `serverNames` list is cloned
to protect against subsequent modification.

##### Parameters

| serverNames | the list of desired `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SNIServerName.html`s (or null) |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if the `serverNames` contains `null` element |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the `serverNames` contains more than one name of the same name type |
|---|---|

##### See Also

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

#### public final void
**setUseCipherSuitesOrder**
(boolean honorOrder)

Sets whether the local cipher suites preference should be honored.

##### Parameters

| honorOrder | whether local cipher suites order in `#getCipherSuites` should be honored during SSL/TLS handshaking. |
|---|---|

##### See Also

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

#### public void
**setWantClientAuth**
(boolean wantClientAuth)

Sets whether client authentication should be requested. Calling
this method clears the `needClientAuth` flag.

##### Parameters

| wantClientAuth | whether client authentication should be requested |
|---|---|