网络安全配置IP地址范围?

问题描述 投票:0回答:1

在Android P中,cleartext communication is disabled by default。相反,有两种选择:

  • 需要明确声明清单文件中允许明文通信
  • 或者需要声明允许通过网络安全配置进行明文通信的域。

我的问题与第二种方法有关。我可以在network_security_config.xml中将这样的特定IP地址列入白名单

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">192.168.1.1</domain>
    </domain-config>
</network-security-config>

但是,我想将所有私有IP地址列入白名单。我有一些试错案例,但我无法使其发挥作用。

从本质上讲,是否有一个选项来定义网络安全配置中的一系列IP地址?

android android-security android-9.0-pie
1个回答
0
投票

不,对不起

事实上,我怀疑支持<domain includeSubdomains="true">192.168.1.1</domain>是偶然的,如果他们开始认为<domain>指的是实际域名而不是任意主机值(如IP地址),则可能无法证明其可靠性。

© www.soinside.com 2019 - 2024. All rights reserved.