if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { connectionConfiguration.setTruststoreType("AndroidCAStore"); connectionConfiguration.setTruststorePassword(null); connectionConfiguration.setTruststorePath(null); } else { connectionConfiguration.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"; connectionConfiguration.setTruststorePath(path); }