Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sslrootcert=system #2061

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

yann-soubeyrand
Copy link
Contributor

Hello,

libpq supports using system certificate authorities to verify the server TLS certificate: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT. This PR tries to add compatible behaviour to pgx.

@jackc
Copy link
Owner

jackc commented Jun 25, 2024

LGTM. However, I noticed there are no tests. I know this might be tricky to test, but is there anyway to verify that it actually works?

@yann-soubeyrand
Copy link
Contributor Author

Hello, yes, I didn’t know how to add tests for that (setting up an environment on my workstation to make tests seemed a little bit complicated for the time I had unfortunately…). I guess we can have a test similar to the test for sslrootcert=./path/to/ca-cert.crt, but with a step to install the CA certificate in the system pool?

@jackc
Copy link
Owner

jackc commented Jun 29, 2024

Well, I think I will just merge it. The code looks right. And I don't see any good way to test it either.

@jackc jackc merged commit 6b9ff97 into jackc:master Jun 29, 2024
14 checks passed
@yann-soubeyrand yann-soubeyrand deleted the support-sslrootcert-system branch June 29, 2024 11:33
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.

2 participants