nativescript-community / https

Secure HTTP client with SSL pinning for Nativescript - iOS/Android
https://nativescript-community.github.io/https/
Other
50 stars 42 forks source link

Trust anchor for certification path not found #39

Open mariodiciccio opened 5 years ago

mariodiciccio commented 5 years ago

Hi, i have a problem on nativescript-https 1.0.1.

I installed plugin with tns plugin add nativescript-https but when launch the app, his result is:

nativescript-https > Disabled SSL pinning
JS: Https.request error javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

The code is:

  Https.disableSSLPinning();
  Https.request({
    url: 'https://dominio.com:6943/rest/api/',
    method: 'GET',
    headers: {
      'content-type': 'application/json'
    },
}).then(function(response) {
    console.log('Https.request response', response)
}).catch(function(error) {
    console.error('Https.request error', error)
})

Why? Any idea?

nmocruz commented 4 years ago

are you using self-signed certificates? the certifcate is valid? if no.., it can be your problem, this plugin is not offering nothing to bypass ssl validation errors due invalid certificates.

alessandraferrua commented 4 years ago

I have the same problem, the certificate is valid. Using HTTPer work correctly. Any idea?

luiguild commented 3 years ago

any news about it?

gonzalesgm-git commented 10 months ago

got this very same issue, certifcate is valid and is working on web, but not on mobile. any workaround?

edusperoni commented 10 months ago

These kind of errors usually come from misconfigured servers (like missing chain certs)

There are a few tools that can validate your config, hopefully this one does the trick https://whatsmychaincert.com/