Computer Science

network security config

network_security_config.xml


• Your application can connect to these servers with http:// or https://.
• You trust both system and user certificates.
• When network_security_config.xml is added to the AndroidManifest folder, IP and http settings are completed on the Android (Kotlin) side.

                        <?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <!--Server 1-->
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">x.x.x.x</domain>
        <trust-anchors>
            <certificates src="user" />
            <certificates src="system" />
        </trust-anchors>
    </domain-config>

    <!--Server 2-->
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">y.y.y.y</domain>
        <trust-anchors>
            <certificates src="user" />
            <certificates src="system" />
        </trust-anchors>
    </domain-config>

    <!-- Lokal Server -->
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">z.z.z.z</domain>
        <trust-anchors>
            <certificates src="user" />
            <certificates src="system" />
        </trust-anchors>
    </domain-config>
</network-security-config>