安卓机websocket连接失败,无法验证证书或not well format

发布于 7 年前作者 liwang16276 次浏览最后编辑 7 年前来自 ask

安卓手机,体验版小程序

websocket连接失败,error msg :“could not validate certificate: null”或者“url not well format”

2 回复
na87
na871 楼6 年前

请提供出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

haoxiulan
haoxiulan2 楼6 年前

“url not well format” 是因为ws的url格式问题,例如我的是因为URL里有空格,然后我encodeURI一下,不报“url not well format”了,但是报另外一个错误,“draft refuses handshakebad request”,即拒绝握手, 最后只能把空格替换成其他符号,真的好坑啊