AnsweredAssumed Answered

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

Question asked by Trevor McKeehan on Jun 27, 2017
Latest reply on Jun 29, 2017 by Trevor McKeehan

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()