powered by Jive Software

Smack 4.2.1: Not possible to set KeyStore when implementing secure connections on Android

This issue is in XMPPTCPConnection in function proceedTLSReceived().

After this function checks the KeyStoreType it attempts to initialize the keystore if it was specified. However, everytime it is specified the KeyManagerFactory is hardcoded to get the “sunX509” instance of KeyManagerFactory. This line crashes implementations on android. However it can only occur if a custom keystore is supplied.

Here is the original code from line 748 in XMPPTCPConnection.

KeyManagerFactory kmf = KeyManagerFactory.getInstance(“sunX509”);

I think this should be changed to use KeyManagerFactory.getDefaultAlgorithm()


You are probably right. I usually use a custom SSLContext on Android, so I never personally run into that issue.

I’ve created [SMACK-771] XMPPTCPConnection should use KeyManagerFactory.getDefaultAlgorithm() instead of KeyManagerFactory.getInsta…