Repository navigation
bug: SSH forwarding drops HTTPS behind TLS termination #3674
Description
Activity
- addedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Sep 24, 2026 /assign
🏗️ build-plan
Implementation Plan
Issue type:
fix
Complexity: Low
Confidence: High — root cause reproduced and isolatedSummary
Make the shared SSH gateway resolver return a complete, scheme-aware endpoint. When OpenShell replaces an internal bind authority with the registered external authority, it will carry the external
httporhttpsscheme with it for both CLI and TUI paths.Scope
crates/openshell-core/src/forward.rs: resolve scheme, host, and port as one endpoint decision and expand its unit-test matrix.crates/openshell-cli/src/ssh.rs: use the resolved scheme in the non-bearer SSH path; retain the existing bearer-auth behavior.crates/openshell-tui/src/lib.rs: use the shared resolved scheme for connect, exec, and automatic forwarding.tasks/test.toml: add the focused Rustport_forwardregression to the shared and dedicated frontend-TLS tasks, since conformance alone passed during reproduction and did not exercise the failing SSH relay path.
Implementation Steps
- Extend the shared resolver to return the effective scheme with its host and port. Adopt the external scheme whenever the registered endpoint supplies the reachable authority; otherwise preserve the server-reported endpoint and invalid-URL fallback.
- Update the CLI and all three TUI call sites without changing bearer-auth routing.
- Add unit tests for HTTP-to-HTTPS and HTTPS-to-HTTP replacement, retained non-loopback endpoints, loopback and unspecified addresses, default ports, invalid URLs, and IPv6.
- Configure both frontend-TLS agentgateway tasks to run the focused Rust port-forward test after conformance.
- Run focused unit/component tests, shared and dedicated frontend-TLS E2E, pre-commit, and normal CI checks.
Test Plan
- Unit tests:
openshell-coreresolver matrix, includinghttp://0.0.0.0:8080throughhttps://localhost:<port>. - Integration tests: CLI and TUI package test suites verify all consumers compile and retain existing behavior.
- E2E tests: shared ListenerSet TLS and dedicated Gateway TLS each run conformance plus the Rust
port_forwardtest over a plaintext OpenShell backend.
Risks & Open Questions
- Preserve the current nuanced IPv4/IPv6 and loopback authority selection while coupling the selected authority to its scheme.
- Restrict external scheme adoption to valid HTTP(S) endpoints and retain the current fallback for malformed external URLs.
- Do not change Cloudflare/bearer routing, which already uses the complete external endpoint.
Documentation Impact
None expected. This restores intended transport behavior without changing configuration, public APIs, architecture boundaries, or LSM-sensitive behavior.
Revision 1 — initial plan
- removedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Sep 24, 2026 - addedstate:acceptedA maintainer decided OpenShell should pursue this issueA maintainer decided OpenShell should pursue this issue
on Sep 24, 2026 Hi, @danehans. Thanks for finding this and working to fix. We're not going to hold the 0.1.0 release for it, but we'll welcome it any time after that. Tagged it for the next weekly after for now.
Reacted by Daneyon Hansen@purp thanks for the feedback. The fix for this issue is included in a larger PR that adds support for agentgateway as a k8s ingress. Let me know if you need me to split the fix out of this PR but I'm hoping both can land.
No worries, and no need to split it just for this.
Reacted by Daneyon Hansen- added a commit that references this issue
on Oct 7, 2026
User Story
As an OpenShell user connecting through a TLS-terminating gateway, I want SSH-backed connect and forwarding operations to use the registered HTTPS endpoint so that sandbox sessions work through the gateway.
Problem Statement
When the gateway reports an internal loopback or unspecified HTTP endpoint, the client replaces its host and port with the registered external gateway authority but retains the internal
httpscheme. It therefore sends plaintext HTTP/2 to the external TLS listener. The operation fails with a misleadingGOAWAY FRAME_SIZE_ERROR.This affects shared client logic used by the CLI and TUI and is not specific to agentgateway.
Impact / Why This Matters
Sandbox creation can succeed while connect, exec, and port-forwarding operations fail as soon as they establish the SSH relay. Users must avoid frontend TLS termination or use a topology whose backend scheme happens to match the frontend scheme. Neither workaround supports a general TLS-terminating ingress deployment.
Acceptance Criteria
httporhttpsscheme is used too.http://0.0.0.0:8080endpoint resolved through an externalhttps://localhost:<port>endpoint.Reproduction Steps
https://endpoint with the OpenShell CLI.GOAWAY FRAME_SIZE_ERRORon the client andInvalidContentTypeon the TLS proxy.Environment
590ab2abdwith the in-progress feat(helm): support agentgateway ingress #2469 agentgateway E2E changesv0.0.0-alpha.3528a428kubectl port-forwardand direct k3d load-balancer accessLogs
Investigation
CreateSshSessionreports the backend bind scheme, which ishttpwhen TLS terminates at the ingress. Client endpoint reconstruction replaces only the internal host and port with the external endpoint authority. For example: