1、在res/xml檔案夾下面建立network_security_config.xml檔案
<network-security-config>
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
2、application中引用
android:networkSecurityConfig="@xml/network_security_config"