当前位置: 代码迷 >> 综合 >> Smack报错:Trust anchor for certification path not found
  详细解决方案

Smack报错:Trust anchor for certification path not found

热度:28   发布时间:2023-10-18 01:48:39.0

信任锚认证路径没有找到。



解决方法:增加setSecurityMode()方法。

XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setHost("192.168.1.222");
configBuilder.setPort(5222);
configBuilder.setServiceName("192.168.1.222");
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
final AbstractXMPPConnection connection =new XMPPTCPConnection(configBuilder.build());

  相关解决方案