Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions) Summary: [Constants](https://developer.android.com/reference/android/net/dns/HttpsRecord#constants) \| [Methods](https://developer.android.com/reference/android/net/dns/HttpsRecord#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/dns/HttpsRecord#inhmethods)

# HttpsRecord

*** ** * ** ***


`
public


class
HttpsRecord
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.dns.HttpsRecord |

<br />

*** ** * ** ***

Class to represent a HTTPS DNS response record.

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

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/dns/HttpsRecord#DEFAULT_ALPN_ID` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getAlpnIds()() ` Returns the list of Application-Layer Protocol Negotiation (ALPN) protocol identifiers contained in the HTTPS record. |
| ` https://developer.android.com/reference/android/net/ssl/EchConfigList` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getEchConfigList()() ` Returns the `https://developer.android.com/reference/android/net/ssl/EchConfigList` contained in the HTTPS record, if present. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/net/InetAddress>` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getIpAddressHints()() ` Returns the list of IP hints (IPv4 \& IPv6) contained in the HTTPS record. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getOwnerName()() ` Returns the owner name of the HTTPS record. |
| ` int` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getPort()() ` Returns the port of the HTTPS record, defaulting to 443 if not specified in the record. |
| ` int` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getPriority()() ` Returns the priority of the HTTPS record, i.e. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/dns/HttpsRecord#getTargetName()() ` Returns the target name of the HTTPS record. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### DEFAULT_ALPN_ID

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public static final String DEFAULT_ALPN_ID
```

<br />

<br />

Constant Value:

"http/1.1"


## Public methods

### getAlpnIds

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public List<String> getAlpnIds ()
```

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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | This value cannot be `null`. <br /> |

### getEchConfigList

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public EchConfigList getEchConfigList ()
```

Returns the `https://developer.android.com/reference/android/net/ssl/EchConfigList` contained in the HTTPS record, if present.

This value should be passed into `https://developer.android.com/` or
`https://developer.android.com/` to enable ECH in a TLS handshake.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/ssl/EchConfigList` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/ssl/InvalidEchDataException` |   |

### getIpAddressHints

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public List<InetAddress> getIpAddressHints ()
```

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 `https://developer.android.com/reference/android/net/dns/HttpsEndpoint#getIpAddresses()` instead.

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/net/InetAddress>` | This value cannot be `null`. <br /> |

### getOwnerName

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public String getOwnerName ()
```

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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getPort

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public int getPort ()
```

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

See RFC 9460 7.2 for more details.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getPriority

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public int getPriority ()
```

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.

<br />

| Returns ||
|---|---|
| `int` | Value is between 0 and 65535 inclusive <br /> |

### getTargetName

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions)

```
public String getTargetName ()
```

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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |