Android Socket.io Websocket 传输在 SSL 中不起作用 [英] Android Socket.io Websocket Transport does not works in SSL
本文介绍了Android Socket.io Websocket 传输在 SSL 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 gottox socket.io java 客户端进行 Android 聊天应用.
我可以在 HTTP 模式下连接到 web-socket 和 Xhr 传输.但是当我切换到 HTTPS 时,只有 Xhr 模式在工作.我使用了默认的 SSL 上下文,如下所示
I'm using gottox socket.io java client for an Android chat application.
I could connect to both web-socket and Xhr transport in HTTP mode. But when i switch to HTTPS only Xhr mode is working. i used the default SSL Context as below
SocketIO.setDefaultSSLSocketFactory(SSLContext.getInstance("Default"));
这在 Xhr 模式下工作正常.但是在 websocket 传输中没有响应或错误.
This works fine in Xhr mode. But in websocket transport there are no responses or errors.
推荐答案
Websocket with SSL 在 AndroidAsync 中工作.暂时使用它.
Websocket with SSL working in AndroidAsync. Using that for now.
这篇关于Android Socket.io Websocket 传输在 SSL 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文