Question

DO Manage PostgreSQL connection with ASP.NET 5 EF Core, connection string help

**Hello,

I have a Ubuntu droplet running my app, and am also running localy from a MacBook, and I am having truble connecting to it.**

Here is the string I am using:

Host=db-postgresql-fra1-XXXx-do-XXXx-XXX-0.b.db.ondigitalocean.com; Port=25060; Database=XXXX; Username=XXXX; Password=XXXXX; SslMode=Require”

This is the error i get: The remote certificate was rejected by the provided RemoteCertificateValidationCallback

How do I specify the path to the CA Cert, and can I just have it in the project?

Thanks for any help.


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 19, 2022

Hi there,

There are a few ways to do that:

  • Specify the Client Certificate directly in the connection string parameter.
  • Define a PGSSLCERT environment variable.
  • Create a ~/.postgresql/postgresql.crt file with your CA certificate.

For more information I could suggest taking a look at the docs here:

https://www.npgsql.org/doc/security.html?tabs=tabid-1

Let me know if you have any questions.

Best,

Bobby