feat(cli): honor tls settings in `pg_dump` (CLI-2753) by 7ttp · Pull Request #7266 · supabase/cli · GitHub
Skip to content

feat(cli): honor tls settings in pg_dump (CLI-2753) - #7266

Open
7ttp wants to merge 1 commit into
developfrom
7ttp/followup-CLI-2753
Open

7ttp wants to merge 1 commit into
developfrom
7ttp/followup-CLI-2753

Conversation

@7ttp

@7ttp 7ttp commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

TL;DR

remote db dump and the first db pull seed now pass the resolved TLS settings to pg_dump

whats introduced?

pg_dump only got host, port, user, password and database, so a container dump ignored PGSSLMODE=verify-full, trusted any CA, and got turned away by servers that require a client cert.

for the linked project and a remote --db-url, it now gets the resolved sslmode and connect timeout, the root cert under require or verify-*, and the client cert unless the key needs sslpassword
In a container the cert files are mounted read only, and a missing one fails before docker runs

Note

a remote dump that only worked because verification was skipped now fails. local targets and runs without TLS or timeout settings are unchanged

visual rep:
flowchart TD
  conn["resolved connection"] --> remote{"remote target?"}
  remote -- no --> plain["host, port, user, password, database"]
  remote -- yes --> tls["+ sslmode and connect timeout<br/>+ root cert under require or verify-*<br/>+ system root cert forces verify-full<br/>+ client cert unless the key needs sslpassword"]
  tls --> where{"where pg_dump runs"}
  where -- container --> box["cert files checked, then mounted read only<br/>key copied to a private file<br/>verify-* without root cert, or system, uses the image CA bundle"]
  where -- native --> host["host paths kept<br/>verify-* without root cert uses ~/.postgresql/root.crt, else the host CA bundle<br/>system uses the host CA bundle"]
  plain --> dump["pg_dump"]
  box --> dump
  host --> dump
Loading

ref

@7ttp 7ttp self-assigned this Oct 20, 2026
@7ttp
7ttp requested a review from a team as a code owner October 20, 2026 16:58

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Confirmed Claude’s single minor finding: encrypted client-key settings are silently omitted, while native execution can still inherit those settings from the shell. Codex reported no findings. Verification was static; no tests were run.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/command-internal/pg-dump.env.ts:140 error-handling claude Remote TLS connections with sslpassword silently lose their client certificate and key when constructing the dump environment. A server requiring client-certificate authentication can therefore accept the CLI connection but reject pg_dump without an explanation of the omitted settings. Native execution also inherits shell PGSSLCERT/PGSSLKEY values, so omission does not reliably prevent loading the encrypted key.

Stats

Claude findings: 1 · Codex findings: 0 · Confirmed: 1 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/command-internal/pg-dump.env.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant