Compartilhar via


SNIHostName.CreateSNIMatcher(String) Method

Definition

Creates an SNIMatcher object for SNIHostNames.

[Android.Runtime.Register("createSNIMatcher", "(Ljava/lang/String;)Ljavax/net/ssl/SNIMatcher;", "", ApiSince=24)]
public static Javax.Net.Ssl.SNIMatcher? CreateSNIMatcher (string? regex);
[<Android.Runtime.Register("createSNIMatcher", "(Ljava/lang/String;)Ljavax/net/ssl/SNIMatcher;", "", ApiSince=24)>]
static member CreateSNIMatcher : string -> Javax.Net.Ssl.SNIMatcher

Parameters

regex
String

the regular expression pattern representing the hostname(s) to match

Returns

a SNIMatcher object for SNIHostNames

Attributes

Remarks

Creates an SNIMatcher object for SNIHostNames.

This method can be used by a server to verify the acceptable SNIHostNames. For example,

SNIMatcher matcher =
                    SNIHostName.createSNIMatcher("www\\.example\\.com");

will accept the hostname "www.example.com".

SNIMatcher matcher =
                    SNIHostName.createSNIMatcher("www\\.example\\.(com|org)");

will accept hostnames "www.example.com" and "www.example.org".

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