是否可以检测到由于证书无效而关闭了安全 websocket?
如果是这样,怎么做?
不,这是不可能的。
客户端将关闭 1006 代码:
1006
1006 is a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame.
此外,onerror
将调用处理程序,但它没有说明证书或其他特定问题。