Add Network security config to trust user added CA (#130)
Co-authored-by: hikaps <n>
This commit is contained in:
parent
45b3e26a07
commit
4696eb0d68
2 changed files with 18 additions and 2 deletions
|
@ -14,10 +14,10 @@
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:banner="@mipmap/ic_banner"
|
android:banner="@mipmap/ic_banner"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Findroid"
|
android:theme="@style/Theme.Findroid">
|
||||||
android:usesCleartextTraffic="true">
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".PlayerActivity"
|
android:name=".PlayerActivity"
|
||||||
|
|
16
app/src/main/res/xml/network_security_config.xml
Normal file
16
app/src/main/res/xml/network_security_config.xml
Normal 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>
|
Loading…
Reference in a new issue