Skip to content

Commit a4e7e4c

Browse files
committed
Allow user certificate in production builds.
1 parent 728a2c1 commit a4e7e4c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

app/src/main/res/xml/network_security_config.xml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<network-security-config>
2+
<network-security-config xmlns:tools="http://schemas.android.com/tools">
33
<!-- Ref: https://developer.android.com/training/articles/security-config.html -->
44
<!-- By default, do not allow clearText traffic -->
5-
<base-config cleartextTrafficPermitted="false" />
5+
<base-config cleartextTrafficPermitted="false">
6+
<trust-anchors>
7+
<certificates src="system" />
8+
<certificates
9+
src="user"
10+
tools:ignore="AcceptsUserCertificates" />
11+
</trust-anchors>
12+
</base-config>
613

714
<!-- Allow clearText traffic on some specified host -->
815
<domain-config cleartextTrafficPermitted="true">
@@ -24,12 +31,4 @@
2431
<domain includeSubdomains="true">lan</domain>
2532
<domain includeSubdomains="true">localdomain</domain>
2633
</domain-config>
27-
28-
<debug-overrides>
29-
<trust-anchors>
30-
<certificates src="system" />
31-
<certificates src="user" />
32-
</trust-anchors>
33-
</debug-overrides>
34-
3534
</network-security-config>

0 commit comments

Comments
 (0)