我试图使用Smack登录到XMPP服务器.当尝试登录时,我会收到以下错误消息:
SASL authentication PLAIN Failed: not-authorized
我已经能够使用相同凭据的PSI-IM连接并登录服务器.
这是我目前拥有的:
System.setProperty("smack.debugEnabled","true"); XMPPConnection.DEBUG_ENABLED = true; SASLAuthentication.supportSASLMechanism("PLAIN",0); ConnectionConfiguration configuration = new ConnectionConfiguration("chat.bla.com",5223); configuration.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled); configuration.setSocketFactory(new DummySSLSocketFactory()); configuration.setSASLAuthenticationEnabled(true); configuration.setDebuggerEnabled(true); configuration.setServiceName("bla.net"); Connection connection = new XMPPConnection(configuration); try { connection.connect(); connection.login("user@bla.net","blablabla"); } catch (XMPPException e) { e.printstacktrace(); }
这是我使用的DummySSLSocketFactory:http://svn.igniterealtime.org/svn/repos/spark/tags/spark_2_5_3_s/src/java/org/jivesoftware/spark/util/DummySSLSocketFactory.java
我在想,问题是,当我通过PSI连接时,我需要选择“旧式SSL”,但我不知道如何在Java中进行这种操作.
感谢任何帮助