WebSocket 1011 Internal Error vs 1015 TLS Handshake Failure
Both WebSocket 1011 (Internal Error) and 1015 (TLS Handshake Failure) belong to the WebSocket Close Codes category. 1011 indicates that the server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request. Meanwhile, 1015 means that a reserved value indicating the connection was closed because the TLS handshake failed. This code must not be set by an endpoint in a Close frame.
คำอธิบาย
The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
เมื่อคุณพบเห็น
The server hit an unhandled exception or crashed while processing a WebSocket message. This is the WebSocket equivalent of HTTP 500 Internal Server Error.
วิธีแก้ไข
Check the server-side application logs for stack traces and exceptions. Fix the underlying bug that caused the crash and add proper error handling around message processing.
คำอธิบาย
A reserved value indicating the connection was closed because the TLS handshake failed. This code must not be set by an endpoint in a Close frame.
เมื่อคุณพบเห็น
The wss:// (WebSocket Secure) connection failed during the TLS negotiation — commonly due to an expired certificate, untrusted CA, or TLS version mismatch.
วิธีแก้ไข
Verify the server's TLS certificate is valid and not expired. Ensure both client and server support compatible TLS versions (TLS 1.2+). Check that intermediate certificates are properly chained.
ความแตกต่างหลัก
WebSocket 1011: The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
WebSocket 1015: A reserved value indicating the connection was closed because the TLS handshake failed. This code must not be set by an endpoint in a Close frame.
You encounter 1011 when the server hit an unhandled exception or crashed while processing a WebSocket message. This is the WebSocket equivalent of HTTP 500 Internal Server Error.
You encounter 1015 when the wss:// (WebSocket Secure) connection failed during the TLS negotiation — commonly due to an expired certificate, untrusted CA, or TLS version mismatch.
ควรใช้อันไหนเมื่อไร
For 1011 (Internal Error): Check the server-side application logs for stack traces and exceptions. Fix the underlying bug that caused the crash and add proper error handling around message processing. For 1015 (TLS Handshake Failure): Verify the server's TLS certificate is valid and not expired. Ensure both client and server support compatible TLS versions (TLS 1.2+). Check that intermediate certificates are properly chained.