0

I have a PostGIS DB at a remote server and I can connect to it from my desktop using pgAdmin4. However, when I try to connect though QGIS (v3.4) I get an error:

FATAL: no pg_hba.conf entry for host "10.1.<complete ip here>..., user "car_r" database "car", SSL off

The funny thing is that my computer is listed on the server pg_hba.conf or else I would not be able to connect using pgAdmin4.

Any idea what could be wrong?

Adding more info

My PostGIS server is setup to accept only secure connections (hostssl in the pg_hba.conf). When I force QGIS to use SSL, (SSL mode: require) I get a "SSL error: certificate verify failed" error.

How can I make QGIS recognize my server certificate?

5
  • is 10.1.x.x the only ip address your machine has? do you have ipv6 enabled? what is the relevant line from your hba file?
    – Ian Turton
    Commented Oct 10, 2019 at 17:03
  • Our network has ipv6 enabled. I don't have access to the pg_hba.conf file so I don't know how it was done on the server. Will go after my sysadmin.
    – Daniel
    Commented Oct 10, 2019 at 17:19
  • do you type a passwd in pgadmin4? - might be set to trust or peer which will fail when QGIS sends a password
    – Ian Turton
    Commented Oct 10, 2019 at 17:20
  • I type a password on both pgadmin and QGIS
    – Daniel
    Commented Oct 10, 2019 at 18:44
  • When I wrote that I type a password, I meant that I was using a password. But as I wrote in my answer, the problem happens when I save the password using QGis authentication.
    – Daniel
    Commented Oct 16, 2019 at 12:50

1 Answer 1

2

Looks like I've hit a known QGis bug.

If we use authentication on the PostGIS connection (that is, store the password securely), the connection using SSL fails. If instead I remove my authentication and type the user/password every time, the connection works.

Here is the link to the bug report:
https://github.com/qgis/QGIS/issues/25569

or

https://issues.qgis.org/issues/17672

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.