0
\$\begingroup\$

I'm using a native android plugin my team made for communication with a server, and as it uses HTTPS I use a certificate with it. Everything's fine with that, the problem is that, in Unity, when I try to use WWW with anything HTTPS, I get this error

V/com.facebook.unity.FB: sending to Unity OnLoginComplete({"error":"Caught exception: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.","callback_id":"5","key_hash":"XXXXXXXX"})

I get this error in particular when trying to use the Facebook SDK to post a picture to the user's timeline. Looking at the source code, it uses Unity's WWW for the POST. If in Unity I never call my native plugin's methods, then everything works nicely. Is there any way to get around that? Somehow install another certificate? Use some different header? Any help would be great, thanks.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Error which You are getting is standard error generated by Android when given certyficate can't be full checked. Try to validate Your certyficate with tools like: https://www.digicert.com/help/. Yours admin should fix it if its not valid.

If You can't fix certificate then its needed to modify your company plugin to use custom ssl factory/trust manager for request from Android level. This thread on SO seems helpful with understanding the case: https://stackoverflow.com/questions/6825226/trust-anchor-not-found-for-android-ssl-connection

\$\endgroup\$
1
  • \$\begingroup\$ I managed to fix it by following letsencrypt.org and getting a signed certificate, thanks. \$\endgroup\$ Commented Aug 1, 2016 at 13:45
0
\$\begingroup\$

I had a signed certificate which stopped working when I upgraded IOS. I fixed it by adding the intermediate (chain) cert file on the web server. This fixed the problems with IOS but for some reason I still have Android problems, those may or may not be something totally different.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .