Smack 4.1 for Android(sdk >= 23): connect with TLS,how to use system trusted credentials?

Hi, I have trouble about TLS connect in Android , My server has a certificate issued by GlobalSign and I find GlobalSign has a root CA in Android Trusted credentials( Setting - Privacy - Credential storage). so I need use Android System trusted credentials to verify the server’s certificate. Here is my config:


if (Build.VERSION.SDK_INT >= 23){

//TODO: how to config when android sdk >= 23 ?


else if (Build.VERSION.SDK_INT >= 14) {



} else {


String path = System.getProperty(“”);

if (path == null)

path = System.getProperty(“java.home”) + File.separator + “etc”

  • File.separator + “security” + File.separator
  • “cacerts.bks”;



I don’t know how to config when up android 23.

Smack 4.1 has SSLContext to config, does SSLContext can solve this problem? anyone can help me? Thanks!