I am able to load a webpage from a server that uses self-signed certificates on Android just fine without any modifications when using .open on Android.
InAppBrowser.openWebView does not work on Android for me.
On iOS both .open and .openWebView do not work at all, it seems like they share mostly the same code, so it makes sense.
It's probably related to the SSL certificates being invalid for the webView.
I have to support self-signed certificates for our in-house on prem servers.
I can make a PR to implement the changes, but if there is a better way, please let me know 😄.
P.S I have 0 experience in Swift/iOS development and just enough in Android, I'm merely hacking my way around these issues to make our PWA (React) wrapped with Capacitor work properly.
I am able to load a webpage from a server that uses self-signed certificates on Android just fine without any modifications when using
.open
on Android.InAppBrowser.openWebView
does not work on Android for me. On iOS both.open
and.openWebView
do not work at all, it seems like they share mostly the same code, so it makes sense.It's probably related to the SSL certificates being invalid for the
webView
.I have to support self-signed certificates for our in-house on prem servers.
On iOS
I can see in the console the following error:
On Android
I can see in Logcat
Which lead me to these SO questions
Working fixes
On iOS
The first step is adding NSAllowsArbitraryLoads , but that alone is enough to make it work it seems.
I was able to make it work by changing this part of the code by using this answer's solution https://stackoverflow.com/a/67500403/2880747
Like so
On android
in
setWebViewClient
insideWebViewDialog
https://github.com/Cap-go/capacitor-inappbrowser/blob/a14ce5c572c04b4f3a27c212bef71577fa7618f5/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java#L322I can make a PR to implement the changes, but if there is a better way, please let me know 😄.
P.S I have 0 experience in Swift/iOS development and just enough in Android, I'm merely hacking my way around these issues to make our PWA (React) wrapped with Capacitor work properly.