Freigeben über


SSLSocket.SetEnabledProtocols(String[]) Method

Definition

Sets the protocol versions enabled for use on this connection.

[Android.Runtime.Register("setEnabledProtocols", "([Ljava/lang/String;)V", "GetSetEnabledProtocols_arrayLjava_lang_String_Handler")]
public abstract void SetEnabledProtocols (string[]? protocols);
[<Android.Runtime.Register("setEnabledProtocols", "([Ljava/lang/String;)V", "GetSetEnabledProtocols_arrayLjava_lang_String_Handler")>]
abstract member SetEnabledProtocols : string[] -> unit

Parameters

protocols
String[]

Names of all the protocols to enable.

Attributes

Exceptions

if one of the protocols is not supported.

Remarks

Sets the protocol versions enabled for use on this connection.

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.

Because of the way the protocol version is negotiated, connections will only be able to use a member of the lowest set of contiguous enabled protocol versions. For example, enabling TLSv1.2 and TLSv1 will result in connections only being able to use TLSv1.

Java documentation for javax.net.ssl.SSLSocket.setEnabledProtocols(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