Skip to content

fix(ssh): show HTTP status and body of a failed tunnel request - #162

Merged
JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:fix/ssh-tunnel-error-status
Nov 19, 2026
Merged

JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:fix/ssh-tunnel-error-status

Conversation

@JanZachmann

@JanZachmann JanZachmann commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When the backend rejects ssh set-connection with a body that has no internalMsg, the error now shows the HTTP status and the body, e.g. HTTP 401 Unauthorized: Unauthorized, instead of unknown error type. An empty body or an empty internalMsg gives the status.
  • A 403 without the backend's error format also says to check that the account has access to the device and that the network is one the backend allows, e.g. a VPN.
  • A failed read of the reply body now names the HTTP status. A 2xx reply that is not the expected JSON, e.g. a proxy login page, shows the parse error, the status and the body instead of only unsupported reply..
  • Server text is cut to 200 characters and control characters are replaced by spaces, so an HTML error page of a proxy or escape sequences do not flood or change the terminal.
  • actix-http is updated to 3.22.0 for RUSTSEC-2026-0552, RUSTSEC-2026-0553 and RUSTSEC-2026-0554, and rustix to 1.1.6 for RUSTSEC-2026-0486.
  • The version is bumped to 0.29.1.

Reason

A tunnel request to a backend that only allows requests from a VPN failed with unknown error type when the VPN was off. The real reply was a 403 from a gateway with the body Forbidden, and only a debug build showed it. With status, body and the hint, the user can tell a network or permission problem from a backend error. omnect-cli cannot tell a gateway 403 from a 403 of the backend without a message, so the hint names both causes.

Not covered: cargo audit still reports bincode (through mbrman 0.6) and chrono (through oauth2 5.0) as unmaintained. oauth2 has no release without chrono; mbrman 0.7 is a separate update.

When the backend rejects the tunnel request without an `internalMsg`
JSON body, e.g. a 403 from a gateway, the error now shows the HTTP
status and the start of the body instead of "unknown error type".
Server text is cut to 200 characters and control characters are
replaced, so an HTML error page or escape sequences do not flood or
change the terminal.

Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
The body-read error now names the HTTP status, and a 2xx reply that is
not the expected JSON shows the serde error, the status and the body.
A 403 without the backend's error format gets a hint: the account may
lack access to the device, or a network filter in front of the backend,
e.g. one that allows only a VPN, refused the request.

Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
actix-http 3.22.0 fixes RUSTSEC-2026-0552, RUSTSEC-2026-0553 and
RUSTSEC-2026-0554; rustix 1.1.6 fixes RUSTSEC-2026-0486.

Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
@JanZachmann
JanZachmann merged commit e73df21 into omnect:main Nov 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant