Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Comments

Use SSL_CERT_FILE env var if set in test builds#62

Merged
nothingmuch merged 2 commits intopayjoin:mainfrom
nothingmuch:testing-cert-root
Mar 12, 2025
Merged

Use SSL_CERT_FILE env var if set in test builds#62
nothingmuch merged 2 commits intopayjoin:mainfrom
nothingmuch:testing-cert-root

Conversation

@nothingmuch
Copy link
Collaborator

When the _test-util feature is enabled, check to see if SSL_CERT_FILE is set and if that's the case use the native roots rustls connector configuration, which expects that variable to point at a pem file.

This allows a self signed certificate to be used for testing purposes, without altering the validation path, but retains webpki roots for normal builds or if the environment variable is not set (i.e. the platform supplied root certificates are not used for test builds, the environment variable must be set for this to take effect).

Replaces #61

When the `_test-util` feature is enabled, check to see if
`SSL_CERT_FILE` is set and if that's the case use the native roots
rustls connector configuration, which expects that variable to point at
a pem file.

This allows a self signed certificate to be used for testing purposes,
without altering the validation path, but retains webpki roots for
normal builds or if the environment variable is not set (i.e. the
platform supplied root certificates are not used for test builds, the
environment variable must be set for this to take effect).
--all-features includes _test-util, so only testing with --all-features
risks breaking the default build.
@nothingmuch nothingmuch changed the title Testing cert root Use SSL_CERT_FILE env var if set in test builds Mar 12, 2025
@nothingmuch nothingmuch requested a review from DanGould March 12, 2025 21:05
@nothingmuch nothingmuch merged commit 43f870d into payjoin:main Mar 12, 2025
5 checks passed
@nothingmuch nothingmuch deleted the testing-cert-root branch March 12, 2025 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants