title: KeyStore integrity check failed
body: <p>I am trying to integrate Facebook Chat in android , so far i have successfully import <code>asmack</code> library and i am trying to login using <code>Facebook JabberID</code>.</p>
  
  <p>i have mentioned the following configuration to connect it with facebook server but the issue is i am getting following error <code>KeyStore integrity check failed</code></p>
  
  <pre><code>06-12 23:18:30.508: W/System.err(2204): java.io.IOException: KeyStore integrity check failed.
  06-12 23:18:30.528: W/System.err(2204):     at org.bouncycastle.jce.provider.JDKKeyStore.engineLoad(JDKKeyStore.java:888)
  06-12 23:18:30.528: W/System.err(2204):     at java.security.KeyStore.load(KeyStore.java:676)
  06-12 23:18:30.538: W/System.err(2204):     at org.jivesoftware.smack.KeyStoreManager.getOrCreateKeyStore(KeyStoreManager.java:42)
  06-12 23:18:30.548: W/System.err(2204):     at org.jivesoftware.smack.XMPPConnection.enableEncryption(XMPPConnection.java:880)
  06-12 23:18:30.548: W/System.err(2204):     at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:900)
  06-12 23:18:30.608: W/System.err(2204):     at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:263)
  06-12 23:18:30.608: W/System.err(2204):     at org.jivesoftware.smack.PacketReader.access$1(PacketReader.java:216)
  06-12 23:18:30.608: W/System.err(2204):     at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
  </code></pre>
  
  <p>here is my code and the <code>TRUST_STORE_PATH</code> path is  <code>/system/etc/security/cacerts.bks</code></p>
  
  <pre><code>ConnectionConfiguration config = 
         new ConnectionConfiguration("chat.facebook.com", 5222);
  
  
          Log.d("PATH" ,TRUST_STORE_PATH + " ");
  
          if (SDK_INT &gt;= 14) {
              config.setTruststoreType("AndroidCAStore");
              config.setTruststorePassword(null);
              config.setTruststorePath(null);
          } else {
              config.setTruststoreType("BKS");
              config.setTruststorePath(TRUST_STORE_PATH);
          }
  </code></pre>
  
  <p>i really dont have any idea about this error and how to get rid off it , i saw following thread but no luck</p>
  
  <p><a href="https://stackoverflow.com/questions/13125609/keystore-with-bouncycastleprovider-keystore-integrity-check-failed">post</a></p>