Categorie
Information and Communications Technology

Connecting PowerBI to PostgreSQL

Connecting PowerBI to PostgreSQL generate this certificate error: “The remote certificate is invalid according to the validation procedure”

We need to estabilish a connection adding the certificate to the trusted certificates.

In this example the PostgreSQL server has ip 10.0.0.5 and hostname pgsql-test-server.

Install latest NPGSQL with msi package from (at this time is v4.1.14):

https://github.com/npgsql/npgsql/releases/

Install openssl command line and extract the certificate with this command:

openssl s_client -starttls postgres -connect 10.0.0.5:5432 > %USERPROFILE%\Desktop\pg-server-cert.cer

The file is saved on the user desktop.

Import the certificate in the Trusted Root Certificate.

Then, IMPORTANT, for the connection do not use the ip, you must use the hostname present in the .cer file as CN.