Open Petru-design opened 2 years ago
You need to add networkconfig.xml file in android folder. Networkconfig.xml look like this: <?xml version="1.0" encoding="UTF-8"?>
Path to add that file: C:\Users\
@Rishabprasad Can you please write /paste here picture or code related to SSL pinning in code and Android Studio code. Stepwise procedure. [For valid and self-signed SSL certificate] .Using IONIC Framework+React+api calling library:capacitor-community/http. please write headers also if necessary for https api calling. I am stuck. Kindly HELP.
C:\Users\\Documents\Project\xyz\android\app\src\main\res\xml\network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">connecttohostserver.com</domain>
<domain includeSubdomains="true">connecttohostserver.net</domain>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</domain-config>
</network-security-config>
<?xml version='1.0' encoding='utf-8'?>
<manifest package="com.project.demo" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" **android:networkSecurityConfig="@xml/network_security_config"** android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" **android:usesCleartextTraffic="true"**>
@Rishabprasad Thanks for Android studio code. Please share SSL Pinning code in React. How to call apis with ssl pinning. Please share code.
@Rishabprasad Can you paste the pinning code here for reference. as It is not working for self-signed certificate [Internal company] for https url. It is throwing SSLHANDSHAKEEXCEPTION ERROR after including your android studio code. I am using IONIC Framework+ React+ capacitor-community/http for api calling. HELP.!
Request to https domain fails with SSLHandshakeException.
I am trying to perform http requests to my backend api server, which has a valid certificate and is running https. Unfortunately, the request to my particular domain fails, as can be seen in the screenshot attached. Is this an issue with the certificate? I have been reading something about SSL pinning, but not sure that means and how to do it
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
Smartphone (please complete the following information):