嗨,我想连接到openfire服务器。使用以下代码:
ConnectionConfiguration config = new ConnectionConfiguration(hostName, 5222);
XMPPConnection connection = new XMPPConnection(config);
try {
connection.connect();
} catch (XMPPException e) {
if (e != null){
Log.d(",myapp", Log.getStackTraceString(e));
}
}
try {
connection.login(userName, "password");
} catch (XMPPException e) {
if (e != null){
Log.d("XMPPConnection", "Authentication Failure");
}
}
它在connection.connect()上失败;堆栈跟踪是:
06-04 15:23:51.961: D/,myapp(20261): Connection failed. No response from server.:
06-04 15:23:51.961: D/,myapp(20261): at org.jivesoftware.smack.PacketReader.startup(PacketReader.java:115)
06-04 15:23:51.961: D/,myapp(20261): at org.jivesoftware.smack.XMPPConnection.initConnection(XMPPConnection.java:655)
06-04 15:23:51.961: D/,myapp(20261): at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:615)
06-04 15:23:51.961: D/,myapp(20261): at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1034)
06-04 15:23:51.961: D/,myapp(20261): at com.coffeeenterprise.resources.ConnectToXMPPTask.doInBackground(ConnectToXMPPTask.java:30)
06-04 15:23:51.961: D/,myapp(20261): at com.coffeeenterprise.resources.ConnectToXMPPTask.doInBackground(ConnectToXMPPTask.java:1)
06-04 15:23:51.961: D/,myapp(20261): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-04 15:23:51.961: D/,myapp(20261): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-04 15:23:51.961: D/,myapp(20261): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-04 15:23:51.961: D/,myapp(20261): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-04 15:23:51.961: D/,myapp(20261): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-04 15:23:51.961: D/,myapp(20261): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-04 15:23:51.961: D/,myapp(20261): at java.lang.Thread.run(Thread.java:856)
在服务器端,消息是:
at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:171)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:814)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:727)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.apache.mina.filter.support.SSLHandler.unwrap0(SSLHandler.java:658)
at org.apache.mina.filter.support.SSLHandler.unwrapHandshake(SSLHandler.java:614)
at org.apache.mina.filter.support.SSLHandler.handshake(SSLHandler.java:493)
at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:306)
at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:392)
... 14 more
2013.06.04 14:16:32 org.jivesoftware.openfire.nio.ConnectionHandler - ConnectionHandler reports IOException for session: (SOCKET, R: /184.151.127.182:33096, L: /66.228.58.218:5223, S: 0.0.0.0/0.0.0.0:5223)
我试过在连接配置上使用不同的设置,比如玩安全模式。我也试过给它一个回调处理程序,但是从来没有调用过。
编辑:启用调试后,我得到以下信息:
06-05 09:22:20.044: D/SMACK(7597): 09:22:20 AM SENT (1106505464): <stream:stream to="coffeemobile.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
06-05 09:22:20.084: D/SMACK(7597): 09:22:20 AM SENT (1106505464): </stream:stream>
通过从ConnectionConfiguration中删除端口号,解决了此问题。
INFO[Thread-3]2015-01-25 09:00:21,383 ThriftServer.java(第135行)监听节俭客户机...错误[Thrift:1]2015-01-25 09:00:30,486 TNegotiaTingServerTransport.java(第523行)未能打开服务器传输。tTransportException:javax.net.SSL.sslExcept
问题内容: 我正在尝试使用smack 4.1.0运行此代码 这给我一个错误: 并且,在本地openfire服务器中启用调试后,我收到以下消息: 我要去哪里错了? 问题答案: 根据与用户问题的讨论,AS位于XMPPTCPConnectionConfiguration中。默认情况下,Openfire中的端口5223是客户端SSL端口, 服务器>>服务器设置>>客户端连接 错误 org.jivesoft
问题内容: 我有一个Java兼容的软件包可以与网络上的https服务器通信。运行编译会产生以下异常: 我认为这是由于与客户端计算机建立的连接不安全。有什么方法可以配置本地计算机或端口以连接到远程https服务器? 问题答案: 我认为这是由于与客户端计算机建立的连接不安全。 这是由于您正在与HTTP服务器而不是HTTPS服务器进行通信。可能您没有为HTTPS使用正确的端口号。
我该如何修复这个问题。多谢提前帮忙
Q-我安装了git以获取最新版本的Angular。当我尝试运行时 我连接到github 443错误失败 我甚至试过 这使我无法连接,没有错误消息。 我在公司防火墙后面。转到控制面板时,我看不到我的代理详细信息- 我终于做到了。我将更新我所采取的程序,以便只是想编译我所做的所有步骤,以使它正常工作
几年前,我已经在Codeigniter(php)中实现了推送通知到我的项目中,直到10天前,一切都运行良好。我的文件在我的本地服务器以及在线通知工具上运行良好。 错误:"stream_socket_client():无法连接到ssl://gateway.push.apple.com:2195(连接拒绝)"。 我正在使用以下功能: