Javax.Net.Ssl.SSLContext.GetInstance Method
Creates a new SSLContext instance for the specified protocol from the specified provider.

Syntax

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/lang/String;)Ljavax/net/ssl/SSLContext;", "")]
public static SSLContext GetInstance (string protocol, string provider)

Parameters

protocol
the requested protocol to create a context for.
provider
the name of the provider that provides the requested protocol.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Security.NoSuchAlgorithmExceptionif the specified provider cannot provider the requested protocol.
Java.Security.NoSuchProviderExceptionif the specified provider does not exits.
Java.Lang.NullPointerExceptionif protocol is null (instead of NoSuchAlgorithmException as in 1.4 release)

Remarks

Creates a new SSLContext instance for the specified protocol from the specified provider.

The following combinations are supported:
ProtocolProviderAPI Levels
DefaultAndroidOpenSSL9+
SSLAndroidOpenSSL9+
SSLHarmonyJSSE9-19
SSLv3AndroidOpenSSL9+
SSLv3HarmonyJSSE9-19
TLSAndroidOpenSSL9+
TLSHarmonyJSSE1-19
TLSv1AndroidOpenSSL9+
TLSv1HarmonyJSSE1-19
TLSv1.1AndroidOpenSSL16+
TLSv1.2AndroidOpenSSL16+

NOTE: The best practice is to rely on platform defaults rather than explicitly specify a provider. SSLContext.Default and SSLContext.GetInstance(string) are normally preferred over this method.

[Android Documentation]

Requirements

Namespace: Javax.Net.Ssl
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1