Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ERROR: connection is insecure (try using `sslmode=require`)

Open
#1,526 4 comments 0 reactions 0 assignees View on GitHub

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
Domain
cli, database

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sequelize/cli

All issues in sequelize/cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.