"TLS connection could not be established: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found."

Hi guys, I’m trying to make a post request but I get a certificate error.

I’m using ionic5 with capacitor and the advanced http plugin and I was wondering if there was any way to solve this?

Could you guys help me out?

Thank you

I would strongly recommend using Angular’s HttpClient instead. Not only is it much less prone to troubles like this, code using it is much cleaner and easier to maintain.

Hi,

So, how can I make SSL Pinning with Angular’s HttpClient instead of advanced-http-plugin?

Hi. I was able to solve it with the advanced http plugin. Use the SSL pinning and put the certificate in this path in IOS ios/App/www/certificates/yourcertificate.cer and in android android/app/src/main/assets/www/certificates/yourcertificate.cer
If you don’t have the www folders created, create them yourself in these paths. Tell me then if it worked for you :slight_smile: