Files
codex/codex-rs/cli
Anton Panasenko 07753325c6 Add WebSocket fallback for OAuth SSH tunnels (#65212)
## Why

Networks that block HTTP/3 and HTTP/2 `CONNECT` can prevent
`codex tcp-tunnel` from establishing an SSH connection.

## What changed

In the default `auto` mode, keep the TCP attempt available when HTTP/3
`CONNECT` is blocked. If HTTP/2 `CONNECT` returns 405, 501, or a 403 with
a `Server` header starting with `Zscaler/`, retry once over an HTTP/1.1
WebSocket. Use WebSocket directly when TLS negotiates HTTP/1.1. Ordinary
authentication and authorization rejections stop setup. The attempts
share the gateway, proxy route, TLS trust, and setup deadline.

Use `--transport websocket` to force WebSocket or `--transport connect`
to use only HTTP/3 and HTTP/2 `CONNECT`. Legacy JWT tunnels use
`CONNECT`.

Preserve independent EOF in both directions. When the remote side
finishes writing, close the output pipe to OpenSSH so it sees EOF
while upload can continue.

## Testing

Add TLS-backed tests for fallback after blocked `CONNECT` responses,
half-close in both directions, terminal gateway rejection, certificate
verification before credential loading, and redirect rejection.

GitOrigin-RevId: cfbbd81a3836da8d1f12bed61bb03c9dfb3674ce
2026-12-02 09:56:45 +00:00
..