Repository navigation
Report rejected authentication to the client with HTTP 401 - #33
Open
NikolaiShipilov wants to merge 3 commits into
Open
NikolaiShipilov wants to merge 3 commits into
NikolaiShipilov wants to merge 3 commits into
Conversation
NikolaiShipilov
force-pushed
the
feature/report-auth-rejection
branch
6 times, most recently
from
November 19, 2026 13:27
0f970d8 to
340962a
Compare
NikolaiShipilov
force-pushed
the
feature/report-auth-rejection
branch
from
November 24, 2026 10:00
340962a to
ece8f21
Compare
JakaMohorko
reviewed
Nov 24, 2026
JakaMohorko
left a comment
Contributor
There was a problem hiding this comment.
Lgtm. 1 minor comment on error code handling.
JakaMohorko
approved these changes
Nov 24, 2026
The server used to drop the connection silently, so clients could not tell rejected credentials from other failures. It now answers with 401 Unauthorized and closes the connection gracefully, bounded by a 5 s timeout.
NikolaiShipilov
force-pushed
the
feature/report-auth-rejection
branch
from
November 25, 2026 09:16
01f4c51 to
ab9638f
Compare
When the server declines the websocket upgrade (any status other than 101), the client now reports its HTTP reply along with the error, so the caller can tell e.g. a rejected authentication (401) from other failures. For any other handshake error the callback gets nullptr.
NikolaiShipilov
force-pushed
the
feature/report-auth-rejection
branch
from
November 25, 2026 09:26
ab9638f to
108e5d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief
When the server rejects authentication it now replies with HTTP 401 instead of silently dropping the connection, and the client passes that reply to its handshake failure callback. This lets callers tell rejected credentials apart from other connection failures.
Description
401 Unauthorizedto the upgrade request and closes the connection gracefully, within a 5 s timeoutwebsocket::error::upgrade_declined), ornullptrwhen no reply was received