1

I have a problem when i test my NativeScript application on android API 17. The installation works fine, but when i try to login with an HTTP request to my HTTPS back-end, the request immediately stops.

This only happens on API 17 and not on higher API.

Error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

http.request({
    url: config.baseUrl + "login",
    method: "POST",
    headers: {"Content-Type": "application/x-www-form-urlencoded"},
    content: "grant_type=password&username=" + this.username + "&password=" + this.password
});
R Pelzer
  • 1,188
  • 14
  • 34

1 Answers1

1

I had the same issue with valid (not-self signed) certificate. It turned out that the CA was not installed on Android Emulator (Nexus 6 - API 21).

I exported CA certificate from my browser and imported it into Emulator.

In order to do that you need SDCard enabled. Then copy the certificate (I did that with via "avd push" command). Then import it from Settings->Security-> Install from SD Card. The same steps should work for self signed certificates.

Emil Alkalay
  • 476
  • 4
  • 16