onOpen fail code:8, msg:TLS handshake failed?
websocket连接,苹果机测试没有问题,安卓机测试全部出现exception onOpen fail code:8, msg:TLS handshake failed的报错
证书测试截图
开发者库
测试安卓版本
8.10, 10, 9
报错代码
linkSocket(){
let that = this
var url = 'wss://ytcloud.yungtay.com.cn:8081/ws';
this.globalData.wxst = wx.connectSocket({
url: url,
method: "GET",
success() {
console.log('连接成功')
that.initEventHandle()
}
})
},
initEventHandle(){
let that = this
wx.onSocketMessage((res) => {
//收到消息
var data = res.data;
console.info(data);
that.globalData.result=data
})
wx.onSocketOpen(()=>{
console.log('WebSocket连接打开')
//this._reset()._start();
})
wx.onSocketError(function (res) {
console.log(res)//exception onOpen fail code:8, msg:TLS handshake failed报错
that.reconnect()
})
wx.onSocketClose(function (res) {
console.log('WebSocket 已关闭!')
that.reconnect()
})
},