Repository navigation
Description
Summary
The gateway's auto-generated self-signed TLS certificate has only a CN (/CN=openclaw-gateway) and no subjectAltName extension. Modern TLS clients (Node ≥17) ignore CN for hostname/IP verification per RFC 6125, so any client probing the gateway by IP or hostname fails with:
Gateway probe failed: Hostname/IP does not match certificate's altnames: IP: 127.0.0.1 is not in the cert's list:
Affected version
OpenClaw 2026.6.10 (also reproduces with any prior cert generated by this code path).
Source
dist/gateway-DJBMYd11.js lines 20–35 invoke openssl req -x509 ... -subj /CN=openclaw-gateway with no -addext "subjectAltName=..." flag.
Reproduction
- Fresh install with
gateway.tls.enabled=trueandgateway.tls.autoGenerate=true(the default). - Run
openclaw gateway status— the CLI probeswss://127.0.0.1:18789and hits the altnames error. - Inspect the generated cert:
openssl x509 -in ~/.openclaw/gateway/tls/gateway-cert.pem -noout -ext subjectAltNameprints no SAN.
Suggested fix
When generating the cert, add SANs for the bind address(es) plus loopback. Minimum useful set: DNS:localhost,DNS:<hostname>,IP:127.0.0.1,IP:::1 plus any non-loopback bind IPs. Equivalent openssl flag: -addext "subjectAltName=DNS:localhost,IP:127.0.0.1,IP:::1,...".
Related issue
The CLI also lacks any built-in trust mechanism for the gateway's own self-signed cert — users must manually set NODE_EXTRA_CA_CERTS to the cert path. Worth considering whether the CLI should auto-trust ~/.openclaw/gateway/tls/gateway-cert.pem for local probes. Happy to file separately if preferred.
Workaround
Regenerate the cert manually:
openssl req -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes \
-keyout gateway-key.pem -out gateway-cert.pem \
-subj /CN=openclaw-gateway \
-addext "subjectAltName=DNS:localhost,DNS:<hostname>,IP:127.0.0.1,IP:::1,IP:<lan-ip>"
…then restart the gateway.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 26, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 1, 2026, 10:47 PM ET / August 2, 2026, 02:47 UTC.
Summary
Keep open for a maintainer security decision: current main still generates a CN-only certificate, although OpenClaw’s local status and supervised probes now pin the known certificate fingerprint instead of depending on hostname verification. The remaining question is whether auto-generated local/dev certificates should also support arbitrary strict hostname-verifying clients, and which identities they may safely assert.
Reproducibility: yes. source-reproducible: fresh auto-generation invokes OpenSSL with only a CN and no SAN in
src/infra/tls/gateway.ts:126. The reportedgateway statusfailure is not established on current main because local loopback WSS probes now use certificate-fingerprint pinning.Root-cause cluster
Relationship:
canonicalCanonical: #96910
Summary: This issue is the canonical open report for the remaining certificate-identity policy. The related TLS pull requests proposed the same general repair but are all closed unmerged.
Members:
same_root_cause: fix(tls): add subjectAltName to auto-generated gateway self-signed certificate (fixes #96910) #96971 - It proposed SAN generation and legacy CN-only replacement for this report, but it closed unmerged.same_root_cause: fix(tls): add subjectAltName to auto-generated gateway self-signed certificate (fixes #96910) #97057 - It proposed the same SAN and certificate-upgrade approach, but it closed unmerged.same_root_cause: fix(tls): add subjectAltName to auto-generated gateway self-signed certificate (fixes #96910) #97085 - It proposed the same certificate-identity repair, but it closed unmerged.same_root_cause: fix(tls): add subjectAltName to auto-generated gateway self-signed certificate (fixes #96910) #100862 - It continued the same SAN proposal and is closed unmerged.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Maintainer decision needed
Why: The current OpenClaw local probe is already secured through certificate fingerprint pinning, while adding SANs or replacing existing certificates changes the identity and upgrade trust boundary for external clients.
Next step
A focused implementation is feasible only after a maintainer chooses the SAN identity scope and whether legacy generated certificates rotate automatically or through Doctor.
Security
Needs attention: The issue concerns a certificate identity boundary: current auto-generated pairs lack SANs, while any broader identity set or legacy rotation must be explicitly bounded.
Review details
Best possible solution:
Keep the fingerprint-pinned loopback probes as the canonical OpenClaw local-client path, then decide whether generated local/dev certificates should additionally carry a narrowly documented loopback SAN set; if yes, rotate only unmistakably OpenClaw-generated legacy pairs through an explicit Doctor repair flow and add real certificate-identity regression coverage.
Do we have a high-confidence way to reproduce the issue?
Yes, source-reproducible: fresh auto-generation invokes OpenSSL with only a CN and no SAN in
src/infra/tls/gateway.ts:126. The reportedgateway statusfailure is not established on current main because local loopback WSS probes now use certificate-fingerprint pinning.Is this the best way to solve the issue?
Unclear: SAN generation alone is not necessarily the best solution because the named OpenClaw local-probe path already authenticates by pinned fingerprint; the remaining external-client behavior needs an explicit identity and upgrade policy.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 5cb0c9df5344.
Label changes
Label justifications:
P2: The remaining behavior affects TLS-enabled gateway users and external strict clients, but current local OpenClaw probes have a fingerprint-pinned path.impact:security: The request changes the identity assertions and trust boundary of automatically generated gateway certificates.maturity:stable: The primary owner is the M4 Gateway runtime security-control surface identified by the maturity helper.Evidence reviewed
Security concerns:
src/infra/tls/gateway.ts:141src/infra/tls/gateway.tsgenerates a certificate with onlyCN=openclaw-gateway; adding SANs or rotating existing certificates changes the identities authenticated by an OpenClaw-controlled private key and must preserve operator-provided certificate paths.Confidence: 0.96
What I checked:
/CN=openclaw-gatewayand no subjectAltName argument. It generates only when both certificate and key are absent, so existing generated pairs are not rotated by this loader. (src/infra/tls/gateway.ts:126, 5cb0c9df5344)src/commands/gateway-status/probe-run.ts:138, 5cb0c9df5344)src/cli/gateway-cli/run.ts:522, 5cb0c9df5344)src/infra/tls/gateway.test.ts:218, 5cb0c9df5344)src/cli/gateway-cli/run.ts:530, 9f3b44a1417a)v2026.7.1; the checked-out main is newer, so this review does not claim the current local-probe behavior shipped in that release. (5cb0c9df5344)Likely related people:
src/infra/tls/gateway.ts,src/cli/gateway-cli/run.ts,src/commands/gateway-status/probe-run.ts)src/infra/tls/gateway.ts,src/infra/tls/gateway.test.ts)src/infra/tls/gateway.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(tls): add SAN to new certs and upgrade existing CN-only certs
test(tls): verify custom certs are not touched by CN-only upgrade
fix(tls): add subjectAltName to auto-generated gateway self-signed ce…
steipete commentedon Oct 24, 2026
Thanks for filing this. We're closing older issues that no longer look actionable on current
main.OpenClaw's own status and supervised probes now pin the gateway certificate fingerprint, so the reported gateway probe failure no longer depends on hostname verification. For strict third-party clients, please supply your own certificate with the SANs you need.
OpenClaw has changed a lot since this was filed. If this still affects you on the latest release, please open a fresh issue with your version and repro steps (feel free to link back here).