playsonmac
playsonmac
Explore posts from servers
DTDrizzle Team
Created by Filip on 8/10/2024 in #help
Error: self-signed certificate in certificate chain
I couldn't get it to work locally, but it turns out that it actually works in the github action so that's good
10 replies
DTDrizzle Team
Created by Filip on 8/10/2024 in #help
Error: self-signed certificate in certificate chain
I have the same issue with Supabase. There was a post saying that this works:
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
Unfortunately, I get ENAMETOOLONG when I encode the supabase certificate into the dbUrl :/
10 replies