Postgres custom root certificates#3381
Conversation
c09cd42 to
2539ba2
Compare
…RNINGS INSTEAD OF A SEA OF RED although probably I should worry about more of those warnings Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
|
We need to make a call on whether to pursue this approach (where the root cert is a guest asset) or one of the previous approaches (where the root cert was part of runtime config). Some considerations:
Are we in a position to make a decision, so that we can move this forward? |
|
Given that the current postgres interface takes its connection string from the guest rather than some label indexing into runtime config, it seems consistent to me that the guest also be able to provide the root CA. I think this is somewhat specific to TLS for databases where it is (annoyingly) common for databases hosts to use private CAs. |
|
@lann Thanks. In that case, if you have a bit of bandwidth, would you be able to take a quick glance at the block starting at https://github.com/spinframework/spin/pull/3381/changes#diff-c1e22382ff034493d23bbce9900875142e6ba2bd5e0ddcfaaa7a71c3291048a8R136 please, and guide me on better ways to retrieve the guest file, because I'm pretty uncomfortable with what I have now! Thanks! (and if you don't have time then no worries) |
|
Faced with the stark reality of actual code implementing my theoretical suggestions I'm suddenly inspired to consider other options... How would you feel about extending the WIT to allow specifying the root CA as a string? resource connection-builder {
constructor(address: string);
set-root-ca: func(root-ca-pem: string) -> result<_, some-error>;
// ...
build: func() -> result<connection, error>;
} |
Initially unenthusiastic. But I guess we could gussy it up in the SDKs to wrap up the builder and filesystem read calls (e.g. I do worry it could be a trap for people who are used to writing connection strings. But I guess the logical conclusion is the SDK could parse out the relevant bit of the connection string and do shenanigans. I'd have to add 'haunted' to that demeanour though. |
Take two.
...
...
Fine. Fine. It's take six.