-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unable to connect using SSL #2934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
its definitely a bug in this library. when we also set
|
This library doesn’t support |
Seems to duplicate #2723 |
PR suggested: #2994 |
PR is ready. Waiting for a maintainer to review and approve. |
@dapeleg-dn Will this PR fix #2558 ? |
My connection string looks as follows:
What do I need to change to make this work? also getting |
The original poster's problem is that GCP Cloud SQL generates a self signed certificate that does not include So, in GCP using Cloud SQL, you end up with a valid CA but invalid CN and node-postgres treats the sslmode So, right now the only option is to use the |
Hi team, I have same issue use pg to connect aws rds with ssl. psql engine: 15.3 import { Pool } from 'pg';
var pool1 = new Pool({
connectionString: 'postgres://user:password@custom-doman-cname:port/db?ssl=true&sslmode=verify-ca&sslrootcert=./ca.pem'
})
or
new Pool({
host: config.dbHost,
database: config.dbName,
user: config.dbUser,
password: config.dbPassword,
max: config.dbMaxConnections,
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync(`${certPath}`).toString(),
},
}) None of them work at all. We will always hit error for connection string because seems like sslmode doesn't work.
Should it a bug? we do need to specifiy sslmode=verify-ca. |
Hey @Arthur-xu - sorry you're hitting that issue. It's not likely to be a bug with node-postgres but rather w/ your configuration, environment, version of node or something else. Node-postgres passes the |
Thank u @brianc , I changed rejectUnauthorized to false it works but its behavior becomes don't verify anything. |
We have a Postgres 14 server that requires TLS to connect. we are able to connect to it using
psql
. Example:but when we try to do that same thing using (as per the documentation):
where in
app.js
we have:we get this error:
we are using version
8.10.0
ofpg
. Is this a bug in this library or is there something wrong we are doing? thanks.The text was updated successfully, but these errors were encountered: