Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wrong version keystore when doing https call

Hello fellow android coders.

I'm trying to do a https secure call from my android code. The call goes fine on the emulator but on the actual Samsung Galaxy device I get a SSL error.

I used crazy bobs method for handling the cetificate. Here is crazy bobs link: http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html.

Problem is I get an error: "wrong version of keystore" inside the custom SSLSocketFactory object.

Any suggestions on what to do to fix this? Thanks.

like image 419
BobSmith Avatar asked Aug 03 '11 20:08

BobSmith


1 Answers

Did you create your keystore with the Bouncy Castle format? All these 3 parameters are mandatory when creating the keystore with keytool (and especially the keystore type must be BKS):

  -storetype BKS
  -provider org.bouncycastle.jce.provider.BouncyCastleProvider
  -providerpath /path/to/bouncycastle.jar

Android uses version 1.46 of bouncycastle, make sure you use this version when creating your keystore Version 1.46 is found here

like image 62
Jcs Avatar answered Sep 25 '22 02:09

Jcs