Repository navigation
fix(gateway): normalize TLS certificate pins - #125276
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 17, 2026 12:40
Contributor
Author
|
Land-ready at Verification completed:
The 2026-08-17 live WAN report is the before-fix behavior proof. Its temporary edge, ports, firewall rule, and scratch state were removed after that run, so the identical authenticated WAN topology was not recreated. The regression exercises the same node-host and worker TLS identity/post-open validation paths with accepted pins and a wrong-pin negative. The latest ClawSweeper comment is the pickup acknowledgment only; it contains no findings or Rank-up moves. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 18, 2026
* fix(gateway): normalize TLS certificate pins * test(gateway): use valid TLS pin fixtures
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Live WAN verification on 2026-08-17 (
access-live-2026-08-17/REPORT.md) found that a node host accepted a pinned self-signed Gateway certificate when the pin usedsha256:<hex>, but worker admission on/__openclaw__/workerrejected the same certificate withgateway tls fingerprint mismatch. Raw or colon-separated hex worked on both paths, so pairing appeared healthy before worker dispatch failed.The direct worker path added in #122683 used the gateway-client package fallback normalizer, while the node-host facade injected a second, prefix-aware normalizer. The two connection paths therefore compared different strings for the same certificate.
Why This Change Was Made
packages/gateway-client/src/client-address-utils.tsnow owns strict TLS-pin normalization. It accepts bare hex, colon-separated hex, and a case-insensitivesha256:prefix, then returns exactly 64 lowercase hexadecimal characters. Short, malformed, and non-hex pins are rejected before certificate verification is disabled.Every TypeScript TLS-pin comparison now uses that owner. The duplicate core normalizer and node-host-only override are removed, while pairing payloads, generic Gateway resolution, node run/install flags, and worker endpoint parsing canonicalize through the shared contract. The worker descriptor stores the canonical pin, so downstream bundle, workspace, desktop-stream, health-probe, and worker WebSocket paths cannot diverge by display spelling.
Production LOC: +110/-68 (net +42) | Tests: +315/-106. The production growth is the explicit security/input boundary for strict 32-byte validation plus user-visible CLI/pairing rejection; the duplicate normalizer and host-only override were deleted.
User Impact
Pinned self-signed or private-CA deployments can use the documented
sha256:spelling without a worker-only dispatch failure. All accepted spellings authenticate identically on the node-host and worker paths. Invalid pins and genuinely different certificate fingerprints still fail closed.Evidence
sha256:<hex>; the owner table also failed for prefixed, short, malformed, and non-hex inputs.gateway tls fingerprint mismatch; changing only the spelling to raw colon-delimited SHA-256 completed the worker turn.pnpm check:changedpnpm buildgit diff --checkThe temporary WAN edge, ports, firewall rule, and scratch state were removed at the end of the cited live run, so the exact authenticated WAN topology was not recreated for this patch. The regression now exercises both TLS identity checking and the worker post-open socket validation with the same accepted pins and wrong-pin negative.