Skip to content

Commit

Permalink
Trust user added CA certificates (#4397)
Browse files Browse the repository at this point in the history
* Update AndroidManifest.xml

* Create network_security_config.xml

* Allow user CA certs: Fix PR lint issues

* Allow user CA certs: Add a new line

---------

Co-authored-by: ABC <[email protected]>
  • Loading branch information
smarthome-abc and ABC authored Jan 17, 2025
1 parent fe8399a commit f6f324c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions android-lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
<issue id="Typos" severity="ignore" />
<issue id="UnknownNullness" severity="informational" />
<issue id="UnusedIds" severity="ignore" />
<issue id="UnusedAttribute">
<ignore regexp="usesCleartextTraffic" />
<ignore regexp="networkSecurityConfig" />
</issue>
</lint>
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/Theme.Jellyfin"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_security_config">

<!-- Legacy service required for AccountManagerMigration -->
<service
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:tools="http://schemas.android.com/tools" >
<base-config cleartextTrafficPermitted="true" tools:ignore="InsecureBaseConfiguration" >
<trust-anchors>
<certificates src="system" />
<certificates src="user" tools:ignore="AcceptsUserCertificates" />
</trust-anchors>
</base-config>
</network-security-config>

0 comments on commit f6f324c

Please sign in to comment.