factor-outbound-pg: Support SslMode::Require#3148
Conversation
When specifying SslMode::Require, postgres clients shouldn't validate TLS certificates: https://www.postgresql.org/docs/current/libpq-ssl.html > require: I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want. It's not a great security mode, but is a really useful feature when you can't easily install a self-signed CA on your host or use a public certificate for the database. Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
|
Manually tested that this change works as expected |
|
This is tricky. It looks like the underlying library doesn't support even parsing If someone wanted to verify CA before this PR their only option was |
|
Ugh (I don't have rust tooling setup rn so didn't see cases, guessed at the name and hoped it'd compile). It also looks like they're at least slightly opposed to adding verify-ca/verify-full as explicit options (rust-postgres/rust-postgres#988) - so I'm not sure what our path forward is. |
|
Looking at this note in https://www.postgresql.org/docs/17/libpq-ssl.html#LIBQ-SSL-CERTIFICATES
We can pretend that Spin always has a root CA file (that happens to contain webpki roots), which at least rationalizes the current behavior with To allow insecure TLS we could (ab)use If none of the above feels acceptable then we're probably left with a rev'ing the |
|
As a complete alternative, we could push this configuration into runtime config with the existing undocumented This would fit my mental model of how Spin "ought to" work, but there are downsides:
|
@itowlson and I discussed this approach and it seems like the best one to us, too. He's going to look at a POC of it. |
When specifying SslMode::Require, postgres clients shouldn't validate TLS certificates:
https://www.postgresql.org/docs/current/libpq-ssl.html
It's not a great security mode, but is a really useful feature when you can't easily install a self-signed CA on your host or use a public certificate for the database.