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

postgres sslmode not respected when using environment variable connection string #260

Open
danielmklein opened this issue Dec 2, 2022 · 1 comment

Comments

@danielmklein
Copy link

Hi there!

We are using Refinery via the CLI, a la refinery migrate -e DATABASE_URL -p ./migrations.

We really want to require SSL connections to our Postgres database, but Refinery is proving problematic for that. When DATABASE_URL is of the form postgres://my_user:my_password@my.db.hostname.com:5432/db_name?sslmode=require, it does not appear that the sslmode param is respected.

When the relevant database is configured to require SSL, we see an error of the form 0: db error: FATAL: no pg_hba.conf entry for host "x.x.x.x", user "my_user", database "db_name", no encryption, indicating that Refinery is not actually using SSL for the connection.

Please let me know if there is more info I can provide to help debugging this!

@danielmklein danielmklein changed the title postgres sslmode=require not respected when using environment variable connection string postgres sslmode not respected when using environment variable connection string Dec 2, 2022
@jxs
Copy link
Member

jxs commented Dec 10, 2022

Hi, and thanks for the interest! This seems akin to #258. Would you like to submit a PR addressing this? I think it's just a matter of adding the query params to Config, see here, and then forward them again on the build_db_url, see here

mossbanay pushed a commit to mossbanay/refinery that referenced this issue Jan 14, 2023
mossbanay pushed a commit to mossbanay/refinery that referenced this issue Jan 14, 2023
mossbanay pushed a commit to mossbanay/refinery that referenced this issue Jan 14, 2023
mossbanay pushed a commit to mossbanay/refinery that referenced this issue Jan 14, 2023
mossbanay pushed a commit to mossbanay/refinery that referenced this issue Jan 14, 2023
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

No branches or pull requests

2 participants