Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.0.2
Plugin version
5.0.0
Node.js version
16.15.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.4
Description
I was looking for how to disable rejectUnauthorized (or how to work with SSL in general) and found nothing in the documentation.
Enabling SSL by passing ssl=true as a query parameter worked, but only got me to the database rejecting a self-signed cert.
Further, I imagined that passing the standard structure for parameters into the config hash might work... I got as far as this (somewhat janky) config... which unfortunately didn't work.
fastify.register(require('@fastify/postgres'), {
connectionString: process.env.DATABASE_URL + '?ssl=true',
ssl: {
rejectUnauthorized: false
}
})
The specific use case is 'connect to a Heroku-hosted DB from a Heroku-hosted Fastify app' which is likely a common use case. Since the latest Postgres library defaults to rejectUnauthorized being 'true' I'm guessing this is what 'broke' things. (Though of course this behavior is more correct.)
Steps to Reproduce
Try to configure SSL.
Expected Behavior
I'd find some documentation for how to configure SSL.