teksi / wastewater

[DEV] Future TEKSI wastewater module, adapted data model to fit VSA-DSS 2020 new standard
https://teksi.github.io/wastewater
GNU General Public License v3.0
1 stars 5 forks source link

Plugin sometimes ignores SSL certificate from pg_service.conf #393

Open cymed opened 2 weeks ago

cymed commented 2 weeks ago

Describe the bug Parts of TEKSI Wastewater's functionality do not work when connecting through a pg_service that includes ssl definition

To Reproduce Exact steps to reproduce the behavior:

  1. Create working pg_service entry in pg_service.conf that requires a ssl certification

[pg_tww] sslrootcert=path_to_rootrcert/foo.crt sslcert=path_to_sslcert/bar.crt sslkey=path_to_sslkey/foobar.key sslmode=verify-full host=1.2.3.4 port=5432 dbname=pg_tww

  1. Start the TEKSI project.
  2. Test functionalities:

Expected behavior Plugin passes SSL client certificate for all functionalities if it is defined in the pg_service.conf

Desktop (please complete the following information):

Additional context I suppose the ssl values are not passed in the database utils.

ponceta commented 2 weeks ago

Thank you @cymed for this pertinent feedback. We have to take this into account when rewriting some of these components.

Can you tell me if the edition of such parameters is already available in pg service parser plugin :

https://plugins.qgis.org/plugins/pg_service_parser/

Since we aim to use its library in the future it would be good to see if any evolution is required on that side and then open a feature proposal on their repo.

cymed commented 2 weeks ago

The pg_service_parser plugin currently supports host, port, dbname, user, password, sslmode and passfile afaik. We'll also have to take into consideration the --dbparams parameter in ili2db TEKSI's Database Config currently passes host, port, dbname, user, password

cymed commented 2 weeks ago

the pgserviceparser library seems to pass the additional parameters, but the pg_service_parser plugin does not support all of them.