Share via


SSLParameters.ServerNames Property

Definition

Returns a List containing all SNIServerNames of the Server Name Indication (SNI) parameter, or null if none has been set. -or- Sets the desired SNIServerNames of the Server Name Indication (SNI) parameter.

public System.Collections.Generic.IList<Javax.Net.Ssl.SNIServerName>? ServerNames { [Android.Runtime.Register("getServerNames", "()Ljava/util/List;", "", ApiSince=24)] get; [Android.Runtime.Register("setServerNames", "(Ljava/util/List;)V", "", ApiSince=24)] set; }
[<get: Android.Runtime.Register("getServerNames", "()Ljava/util/List;", "", ApiSince=24)>]
[<set: Android.Runtime.Register("setServerNames", "(Ljava/util/List;)V", "", ApiSince=24)>]
member this.ServerNames : System.Collections.Generic.IList<Javax.Net.Ssl.SNIServerName> with get, set

Property Value

null or an immutable list of non-null SNIServerNames

Attributes

Remarks

Property getter documentation:

Returns a List containing all SNIServerNames of the Server Name Indication (SNI) parameter, or null if none has been set.

This method is only useful to SSLSockets or SSLEngines 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/SSLEngines. In the following examples, the server name could be represented by an instance of SNIHostName which has been initialized with the hostname "www.example.com" and type StandardConstants#SNI_HOST_NAME.

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

or

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

Added in 1.8.

Java documentation for javax.net.ssl.SSLParameters.getServerNames().

Property setter documentation:

Sets the desired SNIServerNames of the Server Name Indication (SNI) parameter.

This method is only useful to SSLSockets or SSLEngines operating in client mode.

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

Added in 1.8.

Java documentation for javax.net.ssl.SSLParameters.setServerNames(java.util.List<javax.net.ssl.SNIServerName>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to