My issue was due to an incorrect intermediate certificate.
Since it seems many different problems serve up similar symptoms, you can quickly rule out or diagnose the server ssl certificate issue by entering the server name at https://www.sslshopper.com. It will flag problems with your server cert. If it returns a properly set up certificate you can rule out that problem and move on to the next…
I had the same problem, I solved it by checking the javascript console of the ionic server browser page.
I read the error and understand quickly : The app try to connect to my localhost with a new and different port.
I just add a new allowing thing with the good number in my PHP webservice file :
header(‘Access-Control-Allow-Origin: http://localhost:8383’);
header(‘Access-Control-Allow-Origin: http://localhost:8100’); // NEW ASKED PORT * added *
header(“Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization”);
Hi kkraus, I have the similar issue. Works over http but fails over https. I am new these certificates and stuff. can you please tell me how to go forward and provide me steps to solve this issue.
Tried every possible solution provided, but still no luck. Application cannot connect to internet on release build. There is no problem on debug build, but release build cannot connect. Any other solution or fix for this issue?
We got the exact problem getting an https resource served with an autosigned certificate. Worked in standard build but not in release.
It’s probably an ERR_INSECURE_RESPONSE raised by the webview (probably because there is no mean to remotely debug release app, and weinre cannot catch that error…). Just saw @tomkuipers answer about setting ‘android:debuggable=“false”’ in the manifest to help debugging this problem with the inspector.
This is platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:232 that does the switch.
In case of ApplicationInfo.FLAG_DEBUGGABLE , it proceeds despite the error, but in release it does not.
A workaround is to replace “super.onReceivedSslError(view, handler, error);” by “handler.proceed();”. But only for debugging purposes, because doing this will make your app automatically rejected from google play store.
I had the same problem, and I just had to add the tag from cordova-plugin-whitelist readme to my config.xml.
E.g.
<!-- Allow links to example.com -->
<allow-navigation href="http://example.com/*" />
<!-- Wildcards are allowed for the protocol, as a prefix
to the host, or as a suffix to the path -->
<allow-navigation href="*://*.example.com/*" />
<!-- A wildcard can be used to whitelist the entire network,
over HTTP and HTTPS.
*NOT RECOMMENDED* -->
<allow-navigation href="*" />
<!-- The above is equivalent to these three declarations -->
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
Hi conlud, i tried your solution and added cordova-plugin-whitelist into my config.xml file. but it doesnt work for me. so can you help me out… thanks in advance
The app works fine in the browser when I use “serve” mode and works fine when I use “ionic run android -l” mode.
If I install the apk in my device, I not see any http request to my API serve. I logged the server and I can confirm that there are not receiving any request. Also I have whitelist plugin with all configuration parameters in config.xml and in AndroidManifest.xml.
I don’t know what things see. I no have idea. Any suggestion please?