ERROR: connection is insecure (try using `sslmode=require`)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript, node.js, postgresql
Research direction
Start with the Sequelize CLI handling of the --url parameter for db:migrate and trace how the PostgreSQL connection string is passed to the migration connection. Reproduce the command against Neon with sslmode=require, then verify that the migration succeeds without credentials in config.json or environment variables.
Written by the indexing model from the issue text.
Description
Sequelize CLI [Node: 20.18.0, CLI: 6.6.2, ORM: 6.37.4]
I have multiple environments, and for lower environments I run the migrations using the config.json file. However, for Production I don't want to list the credentials in the file, nor do I want to have to set them up as env variables because there are multiple people working on the project and that means that all have to set them.
I would like to run migrations using the --url parameter
Using Postgres, stored on Neon.js. Running
npx sequelize-cli db:migrate --url "postgresql://{{username}}:{{password}}@{{host_url}}/{{db_name}}?sslmode=require"
is throwing an error
ERROR: connection is insecure (try using 'sslmode=require')
I tried using ssl=require, sslMode=require, sslmode=true, not providing it at all, etc.
However, I'm using this exact same connection string to connect the app to the DB, and it works fine. No matter what I do it doesn't seem to take the sslmode param into consideration. Any suggestions?
- Dominant language
- JavaScript
- Stars
- 2.6k
- Forks
- 524
- PR merge metrics
- No merged PRs in 30d
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequelize/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
curriculum documentation quality
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
githubnext/gh-aw-workshop#3897 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
Maintainers usually reply within 1 day