Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
corbusier
Advocate IV
Advocate IV

Get Data from Postgres - Certificate Error

I would like to connect Power BI to Postgres, but it fails with a Certificate Error. The Power BI Desktop version is the latest one, running on Windows 10 Creator's Update. 

 

I'm connecting to the server running the database via ssh, with PuTTY. Then I create a tunnel to forward port 5432. The latest version of Npgsql is installed. (3.2.5)

 

Then, in Power BI Desktop, I connect to localhost (also tried 127.0.0.1)

 

Then, I receive the following error: 

Details: "An error happened while reading data from the provider: 'Npgsql.Tls.ClientAlertException: CertificateUnknown: Server certificate was not accepted. Chain status: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
. The specified hostname was not present in the certificate.
at Npgsql.Tls.TlsClientStream.SendAlertFatal(AlertDescription description, String message)
at Npgsql.Tls.TlsClientStream.ParseCertificateMessage(Byte[] buf, Int32& pos)
at Npgsql.Tls.TlsClientStream.TraverseHandshakeMessages()
at Npgsql.Tls.TlsClientStream.<GetInitialHandshakeMessages>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.Tls.TlsClientStream.<PerformInitialHandshake>d__72.MoveNext()'"

 

According to this post, I should install some certificates from the server. I'm lost. 

4 REPLIES 4
fabiano_
New Member

I'm having the same problem for months.

Npgsql 2.2.5 works. Don't know why

v-chuncz-msft
Community Support
Community Support

@corbusier,

 

Instead, you may try to import data from ODBC, and specify Trust Server Certificate=true in the connection string.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft is there a speed difference between Npgsql and ODBC? 

@corbusier,

 

From my point of view, it won't make a big difference, since both are in import mode.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.