Skip to content

Commit

Permalink
fix: allow user-supplied CA certificates on Android
Browse files Browse the repository at this point in the history
fixes #110
  • Loading branch information
leinelissen committed Jan 10, 2023
1 parent 6885ae6 commit ccfa68c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/react_native_config"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/debug/res/xml/react_native_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>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="user"/>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/react_native_config"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/main/res/xml/react_native_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>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="user"/>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>

0 comments on commit ccfa68c

Please sign in to comment.