Filip
DTDrizzle Team
•Created by Filip on 8/10/2024 in #help
Error: self-signed certificate in certificate chain
Hello I'm trying to drizzle-kit push into Amazon RDS and I'm facing error: "self-signed certificate in certificate chain".
Here is my client setup:
Import { drizzle } from "drizzle-orm/node-postgres";
import { Client } from "pg";
import * as schema from "./schema";
import fs from "fs";
export const client = new Client({
user: process.env.DB_USER,
host: process.env.DB_HOST,
database: process.env.DB_NAME,
password: process.env.DB_PASSWORD,
port: parseInt(process.env.DB_PORT || "5432"),
ssl: {
rejectUnauthorized: false,
ca: fs.readFileSync("certificates/global-bundle.pem").toString(),
},
});
client.connect();
export const db = drizzle(client, { schema });
Here drizzle.config.ts
import { config } from "dotenv";
import { defineConfig } from "drizzle-kit";
config({ path: ".env" });
export default defineConfig({
schema: "./src/db/schema.ts",
out: "./migrations",
dialect: "postgresql",
dbCredentials: {
database: process.env.DATABASE!,
host: process.env.DB_HOST!,
port: parseInt(process.env.DB_PORT!, 10),
user: process.env.DB_USER!,
password: process.env.DB_PASSWORD!,
ssl: true,
},
});
10 replies