host_name in a Server Name
Indication (SNI) extension.
As described in section 3, "Server Name Indication", of TLS Extensions (RFC 6066), "HostName" contains the fully qualified DNS hostname of the server, as understood by the client. The encoded server name value of a hostname is represented as a byte string using ASCII encoding without a trailing dot. This allows the support of Internationalized Domain Names (IDN) through the use of A-labels (the ASCII-Compatible Encoding (ACE) form of a valid string of Internationalized Domain Names for Applications (IDNA)) defined in RFC 5890.
Note that SNIHostName objects are immutable.
SNIServerName, StandardConstants#SNI_HOST_NAME
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public | SNIHostName(String
the hostname of this server name hostname)Creates an |
| public | SNIHostName(byte[]
the encoded hostname of this server name encoded)Creates an |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public static SNIMatcher | Returns: aSNIMatcher object for SNIHostNamesthe regular expression pattern
representing the hostname(s) to match regex)Creates an |
| public boolean | Returns: true if, and only if, theother is considered
equal to this instancethe other server name object to compare with. other)Overrides javax. Compares this server name to the specified object. |
| public String | |
| public int | Returns: a hash code value for thisSNIHostName.Overrides javax. Returns a hash code value for this |
| public String | Returns: a string representation of the object.Overrides javax. Returns a string representation of the object, including the DNS
hostname in this |
| hostname | back to summary |
|---|---|
| private final String hostname | |
| SNIHostName | back to summary |
|---|---|
| public SNIHostName(String hostname) Creates an
Note that per RFC 6066,
the encoded server name value of a hostname is
IDN.toASCII(hostname, IDN.USE_STD3_ASCII_RULES);
The
| |
| SNIHostName | back to summary |
|---|---|
| public SNIHostName(byte[] encoded) Creates an This method is normally used to parse the encoded name value in a requested SNI extension.
Per RFC 6066,
the encoded name value of a hostname is
It is strongly recommended that this constructor is only used to parse
the encoded name value in a requested SNI extension. Otherwise, to
comply with RFC 6066,
please always use
The
Note that the
| |
| checkHostName | back to summary |
|---|---|
| private void checkHostName() | |
| createSNIMatcher | back to summary |
|---|---|
| public static SNIMatcher createSNIMatcher(String regex) Creates an
This method can be used by a server to verify the acceptable
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".
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides javax. Compares this server name to the specified object. Per RFC 6066, DNS hostnames are case-insensitive. Two server hostnames are equal if, and only if, they have the same name type, and the hostnames are equal in a case-independent comparison.
| |
| getAsciiName | back to summary |
|---|---|
| public String getAsciiName() Returns the Note that, per RFC 6066, the returned hostname may be an internationalized domain name that contains A-labels. See RFC 5890 for more information about the detailed A-label specification.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides javax. Returns a hash code value for this
The hash code value is generated using the case-insensitive hostname
of this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides javax. Returns a string representation of the object, including the DNS
hostname in this The exact details of the representation are unspecified and subject to change, but the following may be regarded as typical:
"type=host_name (0), value=<hostname>"
The "<hostname>" is an ASCII representation of the hostname,
which may contain A-labels. For example, a returned value of a pseudo
hostname may look like:
"type=host_name (0), value=www.example.com"
or
"type=host_name (0), value=xn--fsqu00a.xn--0zwm56d"
Please NOTE that the exact details of the representation are unspecified and subject to change. | |
| Access | Constructor and Description |
|---|---|
| pack-priv | SNIHostNameMatcher(String
the regular expression pattern
representing the hostname(s) to match regex)Creates an SNIHostNameMatcher object. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if, and only if, the matcher matches the
given serverNamethe serverName)SNIServerName instance on which this matcher
performs match operationsImplements abstract javax. Attempts to match the given |
| pattern | back to summary |
|---|---|
| private final Pattern pattern | |
| SNIHostNameMatcher | back to summary |
|---|---|
| pack-priv SNIHostNameMatcher(String regex) Creates an SNIHostNameMatcher object.
| |
| matches | back to summary |
|---|---|
| public boolean matches(SNIServerName serverName) Implements abstract javax. Attempts to match the given
| |