0

using keystore to initialize an SSLSocketFactory in an Android project and get the following error:

java.lang.IllegalStateException: SSL keystore not found or invalid...
Caused by: java.io.IOException: Wrong version of key store.
at com.android.org.bouncycastle.jce.provider.JDKKeyStore.engineLoad(JDKKeyStore.java:812)
at java.security.KeyStore.load(KeyStore.java:589)
at com.coolapp.real.ui.android.test.CoolHttpClient.coolSSLSocketFactory(CoolHttpClient.java:77)
... 20 more

how can I solve this problem?

piet.t
  • 11,718
  • 21
  • 43
  • 52
user840930
  • 5,214
  • 21
  • 65
  • 94
  • Please include the code that doesn't work. – Eran Dec 04 '13 at 15:58
  • this was quite a nasty error. the key to solving this problem for us was to find out what version of the keystore the program thought it was reading. We copied the code from the bouncycastle code to print out at the point the error is generated the keystore version number. Ours turned out to be something like 533369037, definitely not 1. We checked the keystore file and the keystore file itself showed 1. Then we realized the context we were sending was wrong so that the resources that were being read from the Android app were in the wrong order. – user840930 Dec 09 '13 at 16:54

0 Answers0