4

I want to connect from QGIS to a PostGIS cluster via SSL.

I'm able to connect via SSL from PgAdmin4 and psql using the same certificates but not from QGIS.

QGIS throws the error:

SSL error: certificate verify failed

PSQL (works fine):

psql "sslmode=verify-ca sslrootcert=server-ca.pem \
      sslcert=client-cert.pem sslkey=client-key.pem \
      hostaddr=XXXXXX \
      port=5432 \
      user=postgres dbname=postgres"

PGAdmin 4 (works fine):

enter image description here QGIS configuration (doesn't work):

This is the connection form. I use a PKI stored identify certificate

enter image description here

I create the PKI stored identify certificate as a PKI PEM/DER Certificate Paths. I provide the path of the client's cert (client-cert.pem) and the client's key (client-key.pem).

enter image description here

The root certificate is also there:

enter image description here

Server error log:

"[214]: [1-1] db=[unknown],user=[unknown] LOG:  could not accept SSL connection: TLSV1_ALERT_UNKNOWN_CA" 

It looks the root certificate is not sent

1
  • I feel the issue is that the authority of the cert (root cert) cannot be passed as a file
    – alasarr
    Commented Jan 20, 2020 at 19:08

1 Answer 1

4

I've finally figured out where I need to place the root authority. Once I added it works!

enter image description here

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.