【发布时间】:2018-02-23 19:38:50
【问题描述】:
我正在尝试连接到 Blah.im XMPP 服务器,但它需要 SSL/TLS 证书才能连接。我正在使用下面的代码进行连接,但是如何在此连接中使用证书?
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.
builder()
.setHost("jabber.blah.im")
.setPort(5222)
.setXmppDomain("blah.im")
.setUsernameAndPassword(username, password)
.setSendPresence(true)
.setSecurityMode(SecurityMode.required)
.setDebuggerEnabled(true)
.build();
XMPPTCPConnection connection = new XMPPTCPConnection(config);
connection.connect();
connection.login();
【问题讨论】: