How to use FluentMigrator with Digital Ocean PGSQL service that requires SSL + cert? #1443
Replies: 1 comment
-
I have found a "workaround" that I'm leaving here in case anyone else has the same problem. I needed to add two elements to my Postgres connection string:
In my case since this is in an ASP.NET / .NET 5 app running inside Docker I chose to put the cert in the Docker image using COPY. This is not a perfect solution, but it works. I also found the following article showing how to build the Postgres setup in .Net for dealing with the certificate stuff: However, this is for the main database connection and doesn't affect FluentMigrator connections. I would love it if it was possible to get some hints about how to do something similar with FM in a way that would allow us to examine the certificate chain in code instead of blindly trusting it like it seems is the case with the connection string workaround. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I asked on Gitter but realize there is not a lot of action there, so checking here as well.
Hi all, I am pretty new to FluentMigrator, using it in my first project and I'm in love with the mental model etc. I have set up quite a few migrations and baked into my .Net 5 project nicely, running against a Postgres server on my local network for development.
However, time has come to deploy to production (at least test deployments), and for that, the Postgres server is on DigitalOcean's managed db thing. They require SSL and certificate usage, so I am required to do stuff to the connection establishing process to get up and running. I do the same in the EF DbContext setup, but of course FluentMigrator uses it's own stuff.
I found issue #968 which suggests to inherit from PostgresProcessor and do stuff in EnsureConnectionIsOpen() - however, I am completely blank as to what I need to do in there.
Is anyone aware of an example of how to provide a certificate for the postgres connection and handle the handshake bits?
Beta Was this translation helpful? Give feedback.
All reactions