mookid8000 / Cirqus

:x: d60 event sourcing + CQRS framework
MIT License
233 stars 39 forks source link

PostgreSQL: Add option for client certificate authentication #87

Closed enriquein closed 7 years ago

enriquein commented 7 years ago

In our current project we need to support using client certificates to authenticate against PostgreSQL. I'd love submit a pull request implementing this functionality, but I wanted to see what would be the ideal way to expose this configuration option through the UsePostgreSql configuration method.

The crux of the issue is that in order to configure Npgsql to use a client certificate, you need to add the certificate to the NpgsqlConnection object using the ProvideClientCertificatesCallback event. Seeing as PostgreSqlEventStore.cs is where the connections are being created, we have no access to the connection construction logic.

Any ideas are greatly appreciated.

mookid8000 commented 7 years ago

hi @enriquein , thanks for your proactive handling of this 😄

I will go through the Rebus code and see if I can make a similar change