Certificate problems with Android Apps

#1 - June 16, 2013, 4:06 p.m.
Blizzard Post

Hey all,

So here is my problem. I wrote a program using the api, as a desktop application, and it all worked fine, no problems.

I decided to expand it and turn it into an android application as well. The program still works as a desktop application but when I try to run it as an android application, it has problems with the certificate.

I have tried using both jGW2API’s hard coded certificate, and the attached ca.cer file for my certificate, but both times the logcat tells me that there is not enough data in the certificate(input stream to be specific).

Anyone know why this is happening/how I can solve it?

Rurik

subnote: Cannot attach .cer file, changed it into .txt file via editing the extension. I hope this doesnst cause any issues.

#13 - June 20, 2013, 6:55 a.m.
Blizzard Post

Hmm interesting, it seems is was failing on the first call, it just wasnt notifying me because the second call overwrote it. So for some reason, all my calls to the api are failing with an IOException in my android app, with a warning of an SSL Exception saying No Trusted Server Certificate, and a CertificateException stating that TrustAnchor for CertPath not found.

Whats strange is that these work perfectly on the pc version of the app and I just dont know what could be going wrong.

Can you post the code relevant to setting up SSL and connecting to the API?

Also, what happens when you visit an API url on your mobile browser? Is there a certificate error?