Skip to content

Pass pg_service.conf SSL options to the connection - #1663

Open
ritojoao wants to merge 1 commit into
dbcli:mainfrom
ritojoao:fix/1474-service-ssl-options
Open

ritojoao wants to merge 1 commit into
dbcli:mainfrom
ritojoao:fix/1474-service-ssl-options

Conversation

@ritojoao

Copy link
Copy Markdown

Fixes #1474

Description

Hello, and thank you for maintaining pgcli.

When connecting with pgcli service=NAME (or PGSERVICE), only host, port, user, dbname and password were read from the service entry. Other parameters such as sslmode, sslrootcert, sslcert and sslkey were silently dropped, so the connection was made without SSL, while psql service=NAME worked.

This change forwards the remaining parameters of the service entry to the connection, like the URI path already does. A regression test covers the SSL options.

I tested it with pytest tests/test_main.py -k service (7 passed). The new test fails without the change and passes with it. ruff format --check is clean.

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install).
  • I verified that my changes work as expected (this may include manually testing them in your local environment, or in other available environments). Cross this out if not relevant (for example, if you're making a documentation change).
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to use pgcli service={service}

1 participant