android - Can't connect to my ejabberd server using Asmack -
getting these errors in logcat:
06-26 02:34:08.352: w/system.err(1261): java.security.keystoreexception: java.security.nosuchalgorithmexception: keystore jks implementation not found 06-26 02:34:08.352: w/system.err(1261): @ java.security.keystore.getinstance(keystore.java:119) 06-26 02:34:08.352: w/system.err(1261): @ org.jivesoftware.smack.servertrustmanager.(servertrustmanager.java:71) 06-26 02:34:08.352: w/system.err(1261): @ org.jivesoftware.smack.xmppconnection.proceedtlsreceived(xmppconnection.java:858) 06-26 02:34:08.352: w/system.err(1261): @ org.jivesoftware.smack.packetreader.parsepackets(packetreader.java:250) 06-26 02:34:08.352: w/system.err(1261): @ org.jivesoftware.smack.packetreader.access$000(packetreader.java:46) 06-26 02:34:08.362: w/system.err(1261): @ org.jivesoftware.smack.packetreader$1.run(packetreader.java:72) 06-26 02:34:08.362: w/system.err(1261): caused by: java.security.nosuchalgorithmexception: keystore jks implementation not found 06-26 02:34:08.362: w/system.err(1261): @ org.apache.harmony.security.fortress.engine.notfound(engine.java:177) 06-26 02:34:08.362: w/system.err(1261): @ org.apache.harmony.security.fortress.engine.getinstance(engine.java:151) 06-26 02:34:08.362: w/system.err(1261): @ java.security.keystore.getinstance(keystore.java:116) 06-26 02:34:08.362: w/system.err(1261): ... 5 more
06-26 02:34:09.802: w/system.err(1261): sasl authentication failed using mechanism digest-md5: 06-26 02:34:09.802: w/system.err(1261): @ org.jivesoftware.smack.saslauthentication.authenticate(saslauthentication.java:341) 06-26 02:34:09.802: w/system.err(1261): @ org.jivesoftware.smack.xmppconnection.login(xmppconnection.java:242) 06-26 02:34:09.802: w/system.err(1261): @ org.jivesoftware.smack.connection.login(connection.java:371) 06-26 02:34:09.802: w/system.err(1261): @ com.example.contactupdater.mainactivity$mainactivity2.login(mainactivity.java:358) 06-26 02:34:09.802: w/system.err(1261): @ com.example.contactupdater.mainactivity$mainactivity2.login(mainactivity.java:347) 06-26 02:34:09.802: w/system.err(1261): @ com.example.contactupdater.mainactivity$1.run(mainactivity.java:320)
here answer problem...
androidconnectionconfiguration config = new androidconnectionconfiguration(server, port); if (build.version.sdk_int >= build.version_codes.ice_cream_sandwich) { config.settruststoretype("androidcastore"); config.settruststorepassword(null); config.settruststorepath(null); } else { config.settruststoretype("bks"); string path = system.getproperty("javax.net.ssl.truststore"); if (path == null) path = system.getproperty("java.home") + file.separator + "etc" + file.separator + "security" + file.separator + "cacerts.bks"; config.settruststorepath(path); }
Comments
Post a Comment