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);
}
asmack正确设置connectionConfiguration
最新推荐文章于 2023-02-08 11:08:28 发布