Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Could not connect to database (no SSL connection possible?) #5

Open
rehno-lindeque opened this issue Mar 12, 2018 · 5 comments
Open

Comments

@rehno-lindeque
Copy link

rehno-lindeque commented Mar 12, 2018

Trying this out on a hosted database I got the following:

connection Error: DbError(PlatformError(PostgresError(GenericError("From conversion", Error(Db(DbError { severity: "FATAL", parsed_severity: None, code: SqlState("28000"), message: "no pg_hba.conf entry for host \"......\", user \"......\", database \"......\", SSL off", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("auth.c"), line: Some(470), routine: Some("ClientAuthentication") }))))))

I suspect (?) the problem may be that SSL is required by the db host, but is turned off by rustorm over here: https://github.com/ivanceras/rustorm/blob/8da5be8dd143591f6ae09d1469fa4a54ba496d40/src/pg/mod.rs#L34

EDIT: note that the hosting is on heroku https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku#ssl

@ivanceras
Copy link
Owner

@rehno-lindeque Thanks for reporting, I'll have to enable ssl in rustorm.

@ivanceras
Copy link
Owner

@rehno-lindeque this requires a little bit of configuration, like pointing to a server.crt file. I haven't used the paid version of heroku, i don't exactly know how the set-up is.

@rehno-lindeque
Copy link
Author

Thanks @ivanceras, I wonder if you can set up your own self-signed certificate on your localhost. Maybe https://www.postgresql.org/docs/10/static/ssl-tcp.html#SSL-CERTIFICATE-CREATION can help.

@ivanceras
Copy link
Owner

@rehno-lindeque I did a self-signed certificate but it seems heroku rejected it stating that it's self signed.

@rehno-lindeque
Copy link
Author

rehno-lindeque commented Mar 13, 2018

Ah for heroku you may want to use https://letsencrypt.org/ for a free certificate. (Hopefully they'll accept that)

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

No branches or pull requests

2 participants