shuttle_shared_db diesel integration does not enable tls, but it is required
What happened?
The pools returned from the shuttle-shared-db diesel-async integrations do not enable TLS, but it is required in deployment, as the Shared Database requires TLS. That means it works for local run with the local Docker postgres database, but not in deployment.
The diesel-async integrations should include a TLS implementation, ideally using Rustls, so that a TLS connection to the database can be established in deployment.
Reproduced with shuttle-shared-db = { version = "0.57.0", features = ["postgres", "diesel-async-deadpool"] }.
Version
v0.57.2
Which operating system(s) are you seeing the problem on?
In deployment
Which CPU architectures are you seeing the problem on?
In deployment
Relevant log output
ERROR postgres: failed to get pool connection: Error occurred while creating a new object: no pg_hba.conf entry for host "10.15.138.104", user "user_TRpidOk0D5QG", database "db_TRpidOk0D5QG", no encryption
Duplicate declaration
- [x] I have searched the issues and there are none like this.
I'd be happy to try and take this on, assuming there's nothing on the platform side that you guys need to do for this to work.
Looks like it can be done relatively easily, following this example: https://github.com/weiznich/diesel_async/blob/main/examples/postgres/run-pending-migrations-with-rustls/src/main.rs