Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeshammz

Relationships

#2359 SWAMP_CA_CERT overrides the --ca-cert flag, contrary to the documented flag-wins precedence

Opened by hammz · 9/22/2026· Shipped 9/28/2026

Summary

When both are set, the SWAMP_CA_CERT environment variable wins over the --ca-cert flag. The manual documents the opposite: tls-and-proxies says the flag takes precedence over the environment variable, and the worker-commands reference says explicit flags take precedence over their environment variables.

Reproduction

SWAMP_CA_CERT=/nonexistent/env-ca.pem swamp worker connect wss://127.0.0.1:1 --ca-cert ./ca.pem --token w.x --no-reconnect

Output (v20260922.185723.0-sha.33229b53 and earlier):

Error: Could not read CA certificate file '/nonexistent/env-ca.pem': No such file or directory (os error 2)

The flag's valid path is ignored.

Cause

resolveCaCertPath in src/cli/remote_run.ts returns the SWAMP_CA_CERT value first and only scans Deno.args for --ca-cert when the variable is unset. It applies to worker connect, auth server login, and every command using withRemoteOptions.

Expected

--ca-cert wins when both are set, matching the documented precedence and every other flag/env pair.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/28/2026, 6:41:03 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
hammz assigned hammz9/28/2026, 6:21:33 PM

Sign in to post a ripple.