HttpsRecord


open class HttpsRecord
kotlin.Any
   ↳ android.net.dns.HttpsRecord

Class to represent a HTTPS DNS response record.

See RFC 9460 for more details on the expected structure and contents.

Summary

Constants
static String

Public methods
open MutableList<String!>

Returns the list of Application-Layer Protocol Negotiation (ALPN) protocol identifiers contained in the HTTPS record.

open EchConfigList?

Returns the EchConfigList contained in the HTTPS record, if present.

open MutableList<InetAddress!>

Returns the list of IP hints (IPv4 & IPv6) contained in the HTTPS record.

open String

Returns the owner name of the HTTPS record.

open Int

Returns the port of the HTTPS record, defaulting to 443 if not specified in the record.

open Int

Returns the priority of the HTTPS record, i.

open String

Returns the target name of the HTTPS record.

Constants

DEFAULT_ALPN_ID

static val DEFAULT_ALPN_ID: String
Value: "http/1.1"

Public methods

getAlpnIds

open fun getAlpnIds(): MutableList<String!>

Returns the list of Application-Layer Protocol Negotiation (ALPN) protocol identifiers contained in the HTTPS record.

If the record does not specify no-default-alpn SvcParamKey, the list will contain the default ALPN ID "http/1.1".

See RFC 9460 7.1 for more details.

Return
MutableList<String!> This value cannot be null.

getEchConfigList

open fun getEchConfigList(): EchConfigList?

Returns the EchConfigList contained in the HTTPS record, if present.

This value should be passed into SSLEngines#setEchConfigList() or SSLSockets#setEchConfigList() to enable ECH in a TLS handshake.

Return
EchConfigList? This value may be null.

getIpAddressHints

open fun getIpAddressHints(): MutableList<InetAddress!>

Returns the list of IP hints (IPv4 & IPv6) contained in the HTTPS record.

This method returns all the hints present in the record, including address families that are not present on the current network. To determine which IP addresses to use when establishing a connection, use HttpsEndpoint.getIpAddresses() instead.

The list is sorted according to RFC 6724. See RFC 9460 7.3 for more details.

Return
MutableList<InetAddress!> This value cannot be null.

getOwnerName

open fun getOwnerName(): String

Returns the owner name of the HTTPS record.

This should be used as the effective target name if the HTTPS record target name is an empty string.

Return
String This value cannot be null.

getPort

open fun getPort(): Int

Returns the port of the HTTPS record, defaulting to 443 if not specified in the record.

See RFC 9460 7.2 for more details.

getPriority

open fun getPriority(): Int

Returns the priority of the HTTPS record, i.e. the contents of the SvcPriority field.

If the priority is 0, the record is considered AliasMode, and will not contain any IP hints, port, ALPN IDs, or ECH configurations. Otherwise, it is ServiceMode.

Because RR sets are unordered, this priority field is used to impose an ordering, where smaller values are recommended for use over those with a larger priority value.

See RFC 9460 2.4 for more details.

Return
Int Value is between 0 and 65535 inclusive

getTargetName

open fun getTargetName(): String

Returns the target name of the HTTPS record.

If the target name is an empty string, RFC 9460 2.5 specifies that this indicates special rules. For AliasMode RRs, this indicates that the service is not available or does not exist. For ServiceMode RRs, this indicates the record's owner name is the effective target name.

Return
String This value cannot be null.