Repository navigation
fix(tls): bound self-signed certificate generation - #109139
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 2:33 AM ET / 06:33 UTC. Summary PR surface: Source +256, Tests +452, Docs +1. Total +709 across 3 files. Reproducibility: yes. for the proposed branch: the supplied redacted live run exercises the production TLS loader with a controlled stalled OpenSSL child, then verifies timeout cleanup and retry. I could not independently rerun that path against the checkout because the read-only command runner was unavailable. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the bounded, staged publication path after normal maintainer review confirms its supported-filesystem behavior and the exact reviewed head remains the one being merged. Do we have a high-confidence way to reproduce the issue? Yes for the proposed branch: the supplied redacted live run exercises the production TLS loader with a controlled stalled OpenSSL child, then verifies timeout cleanup and retry. I could not independently rerun that path against the checkout because the read-only command runner was unavailable. Is this the best way to solve the issue? Yes, based on the supplied evidence: keeping OpenSSL writes out of the configured final paths and publishing only a validated pair is safer than timing out direct writes. The remaining maintainer check is supported-filesystem compatibility, not a competing product direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 6304a47762cc. Label changesLabel justifications:
Evidence reviewedPR surface: Source +256, Tests +452, Docs +1. Total +709 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (10 earlier review cycles; latest 8 shown)
|
f4c3f13 to
5a60a5c
Compare
|
@clawsweeper re-review The partial-output finding is fixed on exact head
The PR body now contains exact-head real production-path proof. A controlled stalled OpenSSL run returned after 30,042 ms, left no configured final entries and no surviving OpenSSL process, then a second call on the same paths succeeded in 401 ms with the expected pair and a |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5a60a5c to
965a011
Compare
b8674b3 to
d000950
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d000950 to
016ae84
Compare
Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
Keep self-signed certificate generation bounded and staged, but fall back to exclusive best-effort writes when hard-link publication is unavailable. Emit a typed gateway TLS degradation warning and preserve startup availability on supported non-atomic filesystems.\n\nCo-authored-by: Alix-007 <[email protected]>
016ae84 to
5d3ca4a
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(tls): bound self-signed certificate generation This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for exact head
Known proof gap: no real mounted filesystem without hard-link support was available, so the non-atomic branch uses the focused ENOTSUP filesystem mock. Blacksmith warmup timed out three times; AWS Crabbox Contributor credit is preserved with |
|
Merged via squash.
|
* fix(tls): bound self-signed certificate generation * fix(tls): stage generated certificate material * docs(changelog): note gateway TLS generation hardening Co-authored-by: Alix-007 <[email protected]> * fix(tls): make generated pair publication recoverable Co-authored-by: Alix-007 <[email protected]> * test(tls): narrow recovery directory fixture * fix(tls): harden atomic certificate publication * chore: drop PR changelog edit Co-authored-by: Alix-007 <[email protected]> * fix(tls): degrade atomic publication failures Keep self-signed certificate generation bounded and staged, but fall back to exclusive best-effort writes when hard-link publication is unavailable. Emit a typed gateway TLS degradation warning and preserve startup availability on supported non-atomic filesystems.\n\nCo-authored-by: Alix-007 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Automatic Gateway TLS setup runs
openssl reqwhen no certificate/key exists. The old path had no timeout and wrote directly to configured final paths, so a stalled or interrupted process could block startup indefinitely or leave partial certificate material.Why This Change Was Made
This branch now implements the maintainer-decided best-effort policy:
runExeclifecycle;ENOTSUP,EOPNOTSUPP, orEPERM), publish through exclusivewxfile handles instead of blocking startup;[GATEWAY_TLS_DEGRADED]warning withgateway:tlsowner metadata when best-effort publication is used.There is no new config, environment variable, dependency, migration, protocol, or schema surface.
CHANGELOG.mdis unchanged.User Impact
A stalled OpenSSL process no longer hangs Gateway startup or writes into configured final paths. Filesystems without hard-link support continue startup with the generated TLS pair and one structured degradation warning.
The non-atomic fallback deliberately does not delete final pathnames on failure because another process may replace them. A failed best-effort write can therefore leave an attempt-owned partial file for operator cleanup; this is the explicit availability-over-atomicity tradeoff selected for this path.
Release-note context: Gateway self-signed TLS generation is now bounded and staged, and unsupported hard-link filesystems use a warned best-effort fallback. Original fix by @Alix-007.
Evidence
5d3ca4adc51e657f0255d5fdce09c694dce0e17a, rebased onto currentmainbefore push.mise exec [email protected] -- node scripts/run-vitest.mjs src/infra/tls/gateway.test.ts: 11/11 passed on the exact rebased tree.publishes best-effort and warns once when hard links are unavailable: 1/1 passed; the harness asserts enabled TLS, private final files, and exactly one typed diagnostic forENOTSUP.OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 node scripts/check-changed.mjs -- src/infra/tls/gateway.ts src/infra/tls/gateway.test.tsunder Node 24.18.0: core and core-test typechecks, targeted lint/format, import cycles, dependency/patch guards, and repository guards passed.run_e694396eb80f/cbx_c81aecb18d7dreached the check command but the raw synced workspace intentionally had no.git, so its conflict-marker guard could not run; the lease stopped cleanly. The trusted-source local fallback above supplied the complete changed gate.fsdocumentation (wx/exclusive creation and copy cleanup behavior), Execa 9.6.1 timeout semantics, OpenClawrunExec, and the sibling backup publication patterns.AI-assisted: yes. Final implementation and evidence were maintainer-reviewed.