Language

DomainEncryptionMode Enum

Definition

Selects the Encrypted Client Hello (ECH) policy for an application's network connections.

public enum DomainEncryptionMode
type DomainEncryptionMode = 
Inheritance
DomainEncryptionMode

Fields

Name Value Description
Unknown 0

Unknown setting for domain encryption in the app.

This is the default value returned by getDomainEncryptionMode(String) when not overridden. Network libraries should avoid performing any domain encryption and perform a standard TLS handshake, equivalent to DOMAIN_ENCRYPTION_MODE_DISABLED.

Android reference for android.security.NetworkSecurityPolicy.DOMAIN_ENCRYPTION_MODE_UNKNOWN.

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.

Disabled 1

Domain encryption is disabled for the app. ECH and GREASE should not be used.

Android reference for android.security.NetworkSecurityPolicy.DOMAIN_ENCRYPTION_MODE_DISABLED.

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.

Opportunistic 2

This constant was deprecated in API level 37.2. Use DOMAIN_ENCRYPTION_MODE_ENABLED instead.

Android reference for android.security.NetworkSecurityPolicy.DOMAIN_ENCRYPTION_MODE_OPPORTUNISTIC.

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.

Enabled 3

Domain encryption is in fully enabled mode for the app. ECH will be enabled when there is server support, otherwise GREASE will be used.

Android reference for android.security.NetworkSecurityPolicy.DOMAIN_ENCRYPTION_MODE_ENABLED.

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.

Required 4

Domain encryption is required for the app and should fail closed (i.e. if ECH cannot be enabled for any reason, the connection will fail).

If a valid ECH configuration is not available (e.g. because the DNS server does not return ECHConfigList in a SVCB/HTTPS record), connections will fail.

Android reference for android.security.NetworkSecurityPolicy.DOMAIN_ENCRYPTION_MODE_REQUIRED.

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.

Remarks

These .NET enum members map to the DOMAIN_ENCRYPTION_MODE_* constants used by NetworkSecurityPolicy. Select one mode, not a combination of modes. The selected mode controls whether a network library uses ECH, uses GREASE when ECH is unavailable, or rejects a connection without ECH.

See the binding enum mappings and the domain encryption policy contract.

Applies to