1

是否可以检测到由于证书无效而关闭了安全 websocket?

如果是这样,怎么做?

4

1 回答 1

2

不,这是不可能的。

客户端将关闭 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将调用处理程序,但它没有说明证书或其他特定问题。

https://www.rfc-editor.org/rfc/rfc6455#section-7.4

于 2014-06-25T19:53:10.043 回答