#14277: fix(CLI): Use wss for probeUrl, when gateway has tls enabled
cli
Cluster:
Gateway and TLS Enhancements
## What does this PR fix?
This PR fixes the probeUrl used when the gateway has TLS enabled. Without this PR the command `openclaw gateway status` reports the following problem when used on a gateway with TLS enabled:
```
<...>
Probe target: ws://10.23.42.157:18789
<...>
RPC probe: failed
RPC target: ws://10.23.42.157:18789
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://10.23.42.157:18789
Source: cli --url
Config: /home/openclaw/.openclaw/openclaw.json
Port 18789 is already in use.
- pid 2076 openclaw: openclaw-gateway (*:18789)
- Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
<...>
```
With this PR applied, the probeUrl uses "wss" as protocol when TLS is enabled and the `openclaw gateway status` command reports no errors.
A small but safe PR for fixing a real problem some users have.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Fixes `openclaw gateway status` failing when TLS is enabled on the gateway. The probe URL was hardcoded to use `ws://`, causing connection failures (abnormal closure 1006) when the gateway expects `wss://`. The fix reads `daemonCfg.gateway?.tls?.enabled` and selects the appropriate scheme, consistent with how `src/gateway/call.ts` already handles this.
<h3>Confidence Score: 5/5</h3>
- Safe to merge — minimal, well-scoped bug fix that follows existing patterns.
- Single-file, 3-line change that adds TLS-aware scheme selection. The pattern (`daemonCfg.gateway?.tls?.enabled === true`) is identical to how the core `callGateway()` function already handles this. No risk of regression for non-TLS users since the default path remains `ws://`.
- No files require special attention.
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#22716: fix: gateway status probe uses wss:// when TLS enabled; accept self...
by Fratua · 2026-02-21
84.9%
#22682: fix(gateway): [P0] status probe ignores gateway.tls.enabled — hardc...
by mahsumaktas · 2026-02-21
83.3%
#21842: fix(gateway-cli): use wss:// scheme when gatewayTls is enabled
by hydro13 · 2026-02-20
81.1%
#21233: docs: clarify bind=lan non-loopback access requires wss or tunnel (...
by saurabhchopade · 2026-02-19
78.2%
#22453: fix(tui): resolve and pass tlsFingerprint for secure connections [A...
by captmoss · 2026-02-21
78.1%
#22804: fix: prioritize loopback for internal gateway calls (issue #22706)
by ambicuity · 2026-02-21
77.4%
#22110: fix(tools): prefer loopback for internal tool-to-gateway RPC calls
by pierreeurope · 2026-02-20
75.2%
#22056: fix(gateway): use loopback for self-connections regardless of bind ...
by usedhonda · 2026-02-20
75.0%
#21000: fix: resolve option collision between browser and cookies set commands
by MisterGuy420 · 2026-02-19
74.5%
#9460: fix(gateway): clean up lock file on service stop
by zenchantlive · 2026-02-05
74.3%