Crosswalk Error about "Request was denied for security"
Asked Answered
M

5

11

I use cordova 6.3.1 and crosswalk of cordova plugin 2.1.0 in Android App. I use self certification in server. When I send http post request from cordova app to server, "Request was denied for security" message appeared in screen bottom possion and http post request is fail. I can send http post request using old crosswalk of cordova plugin(1.5.0). Do you know someone solutions. ※Following site method is not work http://ivancevich.me/articles/ignoring-invalid-ssl-certificates-on-cordova-android-ios/

Mulatto answered 14/10, 2016 at 5:49 Comment(4)
Do you use debug app ?Gibbeon
Yes. I build debug mode(=cordova build android & cordova run android).Mulatto
have you find the solution yet?Asiaasian
Were you able to fix this problem? I'm getting this issue and tried everything alreadySoyuz
H
6

I had the same Toast message displaying Request was denied for security. For me it was also certificate related but the solution was unexpected. The system time of my device was off by quite a bit (almost a year) and this caused the ssl communication to fail. Correcting the time solved it for me. (Thanks to the Google accounts page, which also encountered the same error in the browser and gave a very nice explanation about the reason.)

Hildy answered 3/2, 2017 at 12:25 Comment(1)
Thanks, I had the same issue with a crappy Android phone that for some reason wasn't updating the time automatically and was off by several yearsNumerary
I
1

I solved this by adding the last 3 lines of the following snippet to config.xml:

<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
Incestuous answered 5/12, 2016 at 12:57 Comment(0)
A
1

I was facing the same problem. Try to remove the meta tag for CSP (Content Security Policy), and add the lines below in config.xml:

<access origin="*" />
<allow-intent href="*" />
<allow-navigation href="*" />

Also, I have installed the cordova-plugin-whitelist and the crosswalk-lite. Run cordova clean before build your android app.

I hope it helps!

--- EDIT ---

The above solution only worked in debug mode for me. So, I found a work around using cordova-plugin-crosswalk-certificate with Crosswalk version 18+!

Astolat answered 15/2, 2017 at 15:55 Comment(0)
K
1

If none of the other answer's work, check the date/time and timezone

Knepper answered 13/10, 2017 at 11:59 Comment(0)
I
0

I had my url wrong(Custom domain) with a spelling mistake and you can also check whether the ssl certificate is valid, it gives error, when your ssl certificate is expired.

Indebted answered 8/9, 2017 at 6:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.