0

I have an API rest deploy in an Apache server in Ubuntu 14 but I haven't got a domain. I type an IP address in my calls. I've added a SSL layer and all is ok in browser. But in Android I always get next exception

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

I generate an auto-signed certificate. I don't need authentication. I just need secure conection.

I use the code of android developers' page https://developer.android.com/training/articles/security-ssl.html?hl=es, and I use HttpsURLConnection With HTTP and IP address (without domain) all works.

I have consulted a lot forums and articles but I don't get the solution.

Can somebody help me?

Thanks in advance.

Alberto
  • 11
  • 4
  • The self signed certificates do not work well here. The link you shared has 3 probable reasons for the error. Have a look at it. – someengr May 04 '17 at 12:23
  • "I type an IP address in my calls" -- to be blunt, this is not a wise move. You can never switch to a new server host or ISP (for self-hosted servers), and you cannot deal with the case where the server host or ISP wishes to give you a different IP address (e.g., facilities change). – CommonsWare May 04 '17 at 12:29
  • I agree with you but it is for an university project and I haven't got a domain. Is a temporal solution. In a next phase it will be placed pointing to a domain. – Alberto May 04 '17 at 14:05

0 Answers0