Report this

What is the reason for this report?

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

Posted on July 19, 2022

**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.



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!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.