WebSocket

WebSocket 1000 Normal Closure vs 1015 TLS Handshake Failure

Both WebSocket 1000 (Normal Closure) and 1015 (TLS Handshake Failure) belong to the WebSocket Close Codes category. 1000 indicates that the connection has been closed cleanly, meaning the purpose for which it was established has been fulfilled. Both endpoints agree the session is complete. 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.

Açıklama

The connection has been closed cleanly, meaning the purpose for which it was established has been fulfilled. Both endpoints agree the session is complete.

Gördüğünüzde

The WebSocket connection closed gracefully after both sides finished exchanging data. This is the expected close code for a successful session.

Nasıl Düzeltilir

No fix needed — this indicates everything worked as intended. If you did not expect the connection to close, check your application logic for premature close() calls.

Açıklama

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.

Gördüğünüzde

The wss:// (WebSocket Secure) connection failed during the TLS negotiation — commonly due to an expired certificate, untrusted CA, or TLS version mismatch.

Nasıl Düzeltilir

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.

Temel Farklar

1.

WebSocket 1000: The connection has been closed cleanly, meaning the purpose for which it was established has been fulfilled. Both endpoints agree the session is complete.

2.

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.

3.

You encounter 1000 when the WebSocket connection closed gracefully after both sides finished exchanging data. This is the expected close code for a successful session.

4.

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.

Hangisini Ne Zaman Kullanmalı

For 1000 (Normal Closure): No fix needed — this indicates everything worked as intended. If you did not expect the connection to close, check your application logic for premature close() calls. 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.

Daha Fazla Öğren