Skip to content
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

SSL configs equal to prefer in sslmode #276

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

lucasfcosta
Copy link
Member

A quick look at the pg-connection-string tests seems to suggest that sslmode: prefer is parsed the same as ssl = true;
sequelize/sequelize#16287 (comment)

@@ -50,15 +50,16 @@ async function main() {

const initOptions = {
connectionString: dbUrl,
ssl:
config().NODE_ENV !== 'development' && !config().POSTGRES_SSL_DISABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works, when running locally I get this now:

@briefer/api:dev: [12:24:46.483] ERROR (42023): Uncaught error while starting server
@briefer/api:dev:     err: {
@briefer/api:dev:       "type": "Error",
@briefer/api:dev:       "message": "The server does not support SSL connections",
@briefer/api:dev:       "stack":
@briefer/api:dev:           Error: The server does not support SSL connections
@briefer/api:dev:               at Socket.<anonymous> (/Users/lucas/code/ergomake/briefer/packages/database/node_modules/pg/lib/connection.js:76:37)
@briefer/api:dev:               at Object.onceWrapper (node:events:632:26)
@briefer/api:dev:               at Socket.emit (node:events:517:28)
@briefer/api:dev:               at Socket.emit (node:domain:489:12)
@briefer/api:dev:               at addChunk (node:internal/streams/readable:335:12)
@briefer/api:dev:               at readableAddChunk (node:internal/streams/readable:308:9)
@briefer/api:dev:               at Socket.Readable.push (node:internal/streams/readable:245:10)
@briefer/api:dev:               at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
@briefer/api:dev:     }

Am I missing something? Are you suggesting that I set POSTGRES_SSL_DISABLED to true when running locally? Why not keep the config().NODE_ENV !== 'development'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants