Another SSL error on import

I have an existing database and I wanted to try drizzle on it. Database is from a lesser known provider and is impossible to find reliable help to access it, but unfortunately I cannot change it. I want to use drizzle-kit introspect:pg here is my drizzle.config.ts
import { type Config } from "drizzle-kit"

import { env } from "@/env.mjs"

export default {
schema: "./src/server/db/schema.ts",
driver: "pg",
dbCredentials: {
connectionString: `${env.DATABASE_URL}?sslmode=prefer&ssl={"rejectUnauthorized":true, "ca": "${env.DATABASE_CA}"}`,
},
} satisfies Config
import { type Config } from "drizzle-kit"

import { env } from "@/env.mjs"

export default {
schema: "./src/server/db/schema.ts",
driver: "pg",
dbCredentials: {
connectionString: `${env.DATABASE_URL}?sslmode=prefer&ssl={"rejectUnauthorized":true, "ca": "${env.DATABASE_CA}"}`,
},
} satisfies Config
I also tried connectionString: ${env.DATABASE_URL}?ssl{"rejectUnauthorized":true}, and prety much every permutation between those 2 I could find but I always have the same error :
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

Error: self-signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:515:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
}

Node.js v21.1.0
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

Error: self-signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:515:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
}

Node.js v21.1.0
I tried the answers from the other SSL posts in this discord but unfortunately nothing I tried worked.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server