Partager via


SSLCertificateSocketFactory.SetHostname(Socket, String) Method

Definition

Turns on Server Name Indication (SNI) on a given socket.

[Android.Runtime.Register("setHostname", "(Ljava/net/Socket;Ljava/lang/String;)V", "GetSetHostname_Ljava_net_Socket_Ljava_lang_String_Handler")]
public virtual void SetHostname (Java.Net.Socket? socket, string? hostName);
[<Android.Runtime.Register("setHostname", "(Ljava/net/Socket;Ljava/lang/String;)V", "GetSetHostname_Ljava_net_Socket_Ljava_lang_String_Handler")>]
abstract member SetHostname : Java.Net.Socket * string -> unit
override this.SetHostname : Java.Net.Socket * string -> unit

Parameters

socket
Socket

a socket created by this factory.

hostName
String

the desired SNI hostname, null to disable.

Attributes

Exceptions

if the socket was not created by this factory.

Remarks

Turns on Server Name Indication (SNI) on a given socket.

Java documentation for android.net.SSLCertificateSocketFactory.setHostname(java.net.Socket, java.lang.String).

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