Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b8cabc8 authored by Thiébaud Weksteen's avatar Thiébaud Weksteen
Browse files

Define new NetworkSecurityConfig for localhost

Some default settings for network security config such as
cleartextTrafficPermitted make no sense for localhost connections.

Define a default localhost NetworkSecurityConfig which is only applied
if the application does not already define a NetworkSecurityConfig for
localhost.

An hostname is considered to be localhost if either:
  - The hostname is "localhost" or "ip6-localhost"; or
  - InetAddress.isLoopbackAddress() returns true

Because of the size of the address space for what is considered
localhost, instead of adding entries to the existing Set returned by
getPerDomainConfigs(), a new method is added to ConfigSource:
getLocalhostConfig().

Bug: 398997783
Test: atest CtsNetSecConfigLocalhostCleartextTestCases
Test: atest CtsNetSecConfigLocalhostCleartextWithNscTestCases
Test: atest CtsNetSecConfigLocalhostTlsTestCases
Flag: com.android.org.conscrypt.net.flags.network_security_config_localhost
Change-Id: I608ff46ea5c976976a1b466f39be69cedea3a00c
parent 3f5a77d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment