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


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:; 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:

Let me know if you have any questions.