Prisma Version 1.8
Issue
It is not currently possible to connect to a remote PostgresDB with ssl=true the option is either ignored or not supported.
Reproduction
run > prisma init
options:
Enter connection details for remote database.
CLI throws error:
Could not connect to database. no pg_hba.conf entry for host "86.128.185.193", user "wctuojjcmucvxh", database "d3bjoonnf7l2sq", SSL off
Expected behavior?
The CLI should connect to the remote database
Yup. I was having trouble connecting to an external database from pretty much any database hosting provider (AWS, Heroku, etc).
Thanks! I was able to test the alpha channel (1.10.0-alpha.24) against the latest stable version (1.8.3).
When running prisma init
on the alpha channel, I was asked if I wanted to use ssl. I said I did, and it confirmed my choice. The command finished successfully which is a step in the right direction. On 1.8.3, I wasn't even able to complete prisma init
without getting the same error as @warrenday above.
I was expecting that deciding to use SSL would have some impact on the resulting docker-compose.yml
file, but it did not appear so. I was still getting the same issue after running docker-compose up -d
followed by prisma deploy
.
prisma deploy
spit out it's generic failure message. In the docker logs I got the original error:
Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "98.114.12.243", user "hwouamssimxewe", database "doj9s0n5ddpli", SSL off
While prisma init
seems to be able to temporarily connect to the SSL database, it doesn't seem to preserve the SSL choice in any of the files it generates.
I also wasn't able to get past this issue when trying to manually enable ssl by changing the docker-compose.yml
file that was generated.
Thanks a lot for the update, @andrewjmead! We'll soon double check if any changes to docker-compose.yml
need to be made, or if there is another step that needs to be taken here.
Reopening this because at the moment there is no documented way to pass the ssl
value to prisma docker service.
While the CLI asks for ssl
during prisma init
, that information is not used by the service.
Yeah. I appears the new prisma init
connects to the database just fine over SSL without a cert. It would be nice to see the same behavior carried over to the service.
We are working on this issue from the backend perspective: https://github.com/prismagraphql/prisma/pull/2594
This is not released yet but will be soon.
We will update this issue with instructions and close it then. Thanks!
That's awesome. It looks like that would work great with SSL without certs.
Thanks for this.
npm install -g prisma
1.10
ssl: true
in DB options in docker-compose.yml
file.I can confirm that this is resolved.
Yup! This is working for me too 馃槃
Confirming is working on my end too 馃憤
Most helpful comment
npm install -g prisma
1.10
ssl: true
in DB options indocker-compose.yml
file.I can confirm that this is resolved.