I am using @ionic/angular and want to create an Android and iOS app from my Angular SPA with Capacitor. My backend in the local network has a self-signed certificate (mandatory). In the browser, this is not a problem; the page can be accepted as trustworthy once. However, in my apps, this doesn’t seem to work based on my research.
When I open my Android emulator in Android Studio and make an HTTPS request to the endpoint with the self-signed certificate, I get the following error in the Android Studio Logcat: “handshake failed; returned -1, ssl error code 1, net_error -202”.
Is there a suitable approach to disable the verification on Android and iOS for production? I have already read about a plugin (GitHub - jcesarmobile/ssl-skip) that is supposed to skip the verification, but I’m unsure if this is a viable solution, especially since the app will later be made available on the Android and iOS stores. Additionally, my applications should later have access outside the LAN, so the verification must be active again (must be toggleable).
Since I am still quite new to this environment, I would appreciate an idea for a solution approach.
Thank you.