'Android react-native-webview “SSL Error: Hostname mismatch” (expo)

when I use the WebView on expo with an external uri which I’m not the owner (I’m doing an SSO Auth page that uses cookies), if I open on iOS everything works fine, but if I try on Android it gives me error code 2 "SSL ERROR: Hostname Mismatch" and I can’t open the webpage. I don’t know how to solve this in a good way, I’m using react-native-webview with expo sdk 39 (not bare workflow, but totally with expo). Even if i edit the node_modules files in react-native-webview-removing the handleOnSslError check in Android folder it seems to not detect the changes.

Here the console error showed

I hope hearing from you as soon as possible for a solution or a workaround, I'm really in trouble with this problem for weeks!



Solution 1:[1]

What I did that I tried with nonsecured URL for example:- https://google.com try replacing it with http://google.com and it worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hamid saifi