2

我在清单中添加了网络安全配置,但我仍然收到主机名未验证错误。

<manifest ...>
   android:networkSecurityConfig="@xml/network_security_config"
</manifest>

<network-security-config>
  <domain-config>
    <domain includeSubdomains="true">XXX</domain>
    <trust-anchors>
        <certificates src="system" />
        <certificates src="user" />
        <certificates src="@raw/xxx"/> This is a .cer file
    </trust-anchors>
  </domain-config>
</network-security-config>

但我仍然收到以下错误。

System.err: javax.net.ssl.SSLPeerUnverifiedException: Hostname XXX not verified
4

0 回答 0