Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Not trusted Server Certificate" in Android 2.2 but not 3.0

I'm using the BouncyCastle provider and Apache HttpClient to trust an SSL certificate, as described by Antoine Hauck here.

The app I've made targets Android 1.5, and works fine on the emulator and a device running 3.0. However, when I try to test it on 2.2 (Galaxy S), an SSLException, "Not trusted Server Certificate", occurs.

Since there's no errors complaining about BouncyCastle itself, I'm assuming the device is not reading the certificates properly from the .bks file. Is what I'm attempting possible using BouncyCastle on Android version 2.2, or does something just need to be altered from the working 3.0 app?

Update

When I tried to run the app again today, it worked correctly the first time. I've tried it several times now, and it sometimes runs properly but sometimes still gets the SSLException. There doesn't seem to be any pattern to when this occurs - it might work a few times in a row and then fail repeatedly.

like image 610
caroline Avatar asked Jul 17 '11 15:07

caroline


1 Answers

Could be the provider of the certificate is not trusted, try checking trusted providers

like image 176
Dr. Avatar answered Sep 23 '22 13:09

Dr.