Skip to content

Unable to connect to database while enforcing SSL #3390

Description

@jeffrey-clarion

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I am trying to connect to a database with SSL enforcement enabled from my local computer. I have followed the local development cli guide here: https://supabase.com/docs/guides/local-development/overview and the SSL guide here: https://supabase.com/docs/guides/platform/ssl-enforcement. I have downloaded the CA from my supabase project as advised in the ssl-enforcement docs.

I've run these commands:
supabase login
supabase link --project-ref
supabase db pull

When I run the db pull command I get this error message:
failed to connect to postgres: failed to connect to host=aws-0-us-east-1.pooler.supabase.com user=postgres.<project_id> database=postgres: server error (FATAL: SSL connection is required (SQLSTATE XX000))

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a supabase project in the CLI
  2. Enable SSL (full enforcement) in the database settings
  3. Download the SSL Certificate from the Database Settings page
  4. Create file ~/.postgres/root.crt
  5. Run cat {location of downloaded prod-ca-2021.crt} >> ~/.postgres/root.crt
  6. Run "supabase login"
  7. Run "supabase link --project-ref "
  8. Run "supabase db pull"## Expected behavior
    The "supabase db pull" command succeeds, pulling the migration history from my remote project

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS 14.5, Apple M1 Pro,
  • Version of Supabase CLI: 2.15.8
  • Version of Node.js: v18.20.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale-closedIssue closed by stale cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions