Phonegap/Cordova whitelisted cross domain SSL request not working after exporting APK

后端 未结 2 846
情深已故
情深已故 2020-12-16 06:07

I have created a phonegap app which needs to communicate with a self signed SSL service.

I whitelisted my url in res/xml/cordova.xml like so:

2条回答
  •  不知归路
    2020-12-16 06:31

    The problem is you are using a self-signed cert. The Android WebView does not allow by default self-signed SSL certs. PhoneGap/Cordova overrides this in the CordovaWebViewClient class but does not deviate its behaviour by much; if the app is debug-signed, it will proceed and ignore the error, otherwise it will fail.

    You could change the above-linked to code in your application and make the onReceivedSslError method always call handler.proceed() - but this isn't recommended. Don't use a self-signed certificate!

提交回复
热议问题