Skip to content

Commit def1499

Browse files
committed
mobile: Add support for trusting user-added CAs on Android
1 parent c35b883 commit def1499

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
android:allowBackup="true"
6868
android:icon="@mipmap/ic_launcher"
6969
android:label="@string/app_name"
70-
android:theme="@style/AppTheme">
70+
android:theme="@style/AppTheme"
71+
android:networkSecurityConfig="@xml/network_security_config">
7172
<activity
7273
android:name=".MainActivity"
7374
android:exported="true"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This config was created to address: https://github.com/zulip/zulip-mobile/issues/3312 -->
3+
<network-security-config>
4+
<base-config>
5+
<!-- Trusting user-supplied CAs now requires opt-in, and we are doing so here -->
6+
<trust-anchors>
7+
<certificates src="system" />
8+
<certificates src="user" />
9+
</trust-anchors>
10+
</base-config>
11+
<domain-config>
12+
<!-- Do not trust user-supplied certs for the following Zulip-owned domains (including subdomains) -->
13+
<domain includeSubdomains="true">zulipchat.com</domain>
14+
<domain includeSubdomains="true">zulip.org</domain>
15+
<domain includeSubdomains="true">zulip.com</domain>
16+
<trust-anchors><certificates src="system" /></trust-anchors>
17+
</domain-config>
18+
</network-security-config>
19+
<!-- Reference: https://developer.android.com/training/articles/security-config#FileFormat -->

0 commit comments

Comments
 (0)