WebSocket

WebSocket 1012 Service Restart vs 1015 TLS Handshake Failure

Both WebSocket 1012 (Service Restart) and 1015 (TLS Handshake Failure) belong to the WebSocket Close Codes category. 1012 indicates that the server is terminating the connection because it is restarting. The client should reconnect after a brief delay. 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.

Beschreibung

The server is terminating the connection because it is restarting. The client should reconnect after a brief delay.

Wann Sie es sehen

The server is performing a planned restart — for example, during a deployment or configuration reload. The connection will be available again shortly.

Wie man es behebt

Implement automatic reconnection with a short delay (1-5 seconds). This code signals that reconnecting is expected and should succeed once the server is back up.

Beschreibung

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.

Wann Sie es sehen

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

Wie man es behebt

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.

Wesentliche Unterschiede

1.

WebSocket 1012: The server is terminating the connection because it is restarting. The client should reconnect after a brief delay.

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 1012 when the server is performing a planned restart — for example, during a deployment or configuration reload. The connection will be available again shortly.

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.

Wann welchen verwenden

For 1012 (Service Restart): Implement automatic reconnection with a short delay (1-5 seconds). This code signals that reconnecting is expected and should succeed once the server is back up. 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.

Mehr erfahren