© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
1 reply
dan

certificate issue with database branching and ssl

Hi, I'm trying to configure a project with database branching using the vercel integration. I've got two persistent branches (main and dev) where preview envs are branched off of dev. For some reason, the default postgres_url setup via the integration causes an ssl error
SELF_SIGNED_CERT_IN_CHAIN 
SELF_SIGNED_CERT_IN_CHAIN 


my config for reference
import { Pool } from "pg";

const postgresConfig = {
  connectionString: process.env.POSTGRES_URL,
};

const config = {
  ...(postgresConfig?.connectionString?.includes("localhost")
    ? {}
    : {
        ssl: {
          rejectUnauthorized: true,
          ca: Buffer.from(process.env.POSTGRES_SSL_CA!, "base64").toString("utf-8"),
        },
      }),
  ...postgresConfig,
};

const pool = new Pool(config);

export default pool;
import { Pool } from "pg";

const postgresConfig = {
  connectionString: process.env.POSTGRES_URL,
};

const config = {
  ...(postgresConfig?.connectionString?.includes("localhost")
    ? {}
    : {
        ssl: {
          rejectUnauthorized: true,
          ca: Buffer.from(process.env.POSTGRES_SSL_CA!, "base64").toString("utf-8"),
        },
      }),
  ...postgresConfig,
};

const pool = new Pool(config);

export default pool;
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Seeding the database branching
SupabaseSSupabase / help-and-questions
13mo ago
Branching migration issue
SupabaseSSupabase / help-and-questions
4mo ago
Unsure what to do with SSL certificate from database page inside settings?
SupabaseSSupabase / help-and-questions
4y ago
Migration issue on pgmq with branching?
SupabaseSSupabase / help-and-questions
4mo ago