Add Network security config to trust user added CA (#130)

Co-authored-by: hikaps <n>
This commit is contained in:
hikaps 2022-07-13 22:44:16 +05:30 committed by GitHub
parent 45b3e26a07
commit 4696eb0d68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -14,10 +14,10 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:banner="@mipmap/ic_banner"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Findroid"
android:usesCleartextTraffic="true">
android:theme="@style/Theme.Findroid">
<activity
android:name=".PlayerActivity"

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:tools="http://schemas.android.com/tools">
<!-- Allow cleartext network traffic -->
<base-config
cleartextTrafficPermitted="true"
tools:ignore="InsecureBaseConfiguration">
<trust-anchors>
<!-- Trust pre-installed CAs -->
<certificates src="system" />
<!-- Additionally trust user added CAs -->
<certificates
src="user"
tools:ignore="AcceptsUserCertificates" />
</trust-anchors>
</base-config>
</network-security-config>