我是XMPP的新手,我试图在android studio中设置从我的Android设备到ejabberd-16.04服务器的XMPP连接。但是在用户名和密码登录时遇到问题。
我已从https://community.igniterealtime.org/thread/57209
导入代码我收到此错误 java.security.cert.CertPathValidatorException:找不到证书路径的信任锚。
我的XMPP连接详情是:
private static final String DOMAIN = "localhost";
private static final String HOST = "192.168.1.xxx";
private static final int PORT = 5222;
private String userName ="admin@localhost";
private String passWord = "admin";
当我尝试从移动浏览器进行连接时,相同的凭据正在运行。
XMPP连接代码:
XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setUsernameAndPassword(userName, passWord);
configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
configBuilder.setResource("Android");
configBuilder.setServiceName(DOMAIN);
configBuilder.setHost(HOST);
configBuilder.setPort(PORT);
//configBuilder.setDebuggerEnabled(true);
connection = new XMPPTCPConnection(configBuilder.build());
connection.addConnectionListener(connectionListener);