powered by Jive Software

Issue with Smack API on iPhone

I am trying to write a Google Chat client for the iPhone using the Smack API. I’m running in to a road block after receiving the following exception:

java.security.KeyStoreException: jks
at java.security.KeyStore.getInstance(KeyStore.java:203)
at java.security.KeyStore.getInstance(KeyStore.java:130)
at org.jivesoftware.smack.ServerTrustManager.<init>(ServerTrustManager.java:61)
at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:1115)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:313)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
Caused by: java.security.NoSuchAlgorithmException: Algorithm [jks] of type [KeyStore] from provider --gnu.javax.security.auth.callback.GnuCallbacks: name=GNU-CALLBACKS version=2.1-- is not found
at gnu.java.security.Engine.getInstance(Engine.java:189)
at gnu.java.security.Engine.getInstance(Engine.java:103)
at java.security.KeyStore.getInstance(KeyStore.java:188)
...6 more

I’m fairly certain that it has to do with a problem in the GNU Classpath project, but I am wondering if anyone has seen this type of error before.

Smack uses a few calls that will be very Sun Java specific. I cant quite tell what is going on from that exception, but it looks like something we are doing with the KeyStore’s is not supported by the GNU classpath. What version of Smack are you using?

I’m using the latest version of Smack (3.0.4 I think?). I downloaded it (and the source) on Friday.

From what I’ve gathered on GNU Classpath sites, I believe the issue is that they don’t have the jks algorithm implemented. Instead, they use the “GNOME Keyring” algorithm. Of course, the cacerts file that comes with Java (and exists on the iPhone) isn’t in that format, so I get that error.

Is there any way I can get around the SSL checks? Can I just tell Java to always trust google.com certificates?


the problem is, using Sun’s Java, we need to supply a keystore even if we dont use it. If you know how the GNU stuff works, feel free to modify Smack and post some patches here, Id be willing to incorporate some changes to make things usable outside Sun’s java.