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

Allow injecting certificate for tests #615

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

konstin
Copy link
Member

@konstin konstin commented Dec 12, 2023

Built on #609

When activating the puffin-test-custom-ca-cert feature, you can inject a custom ssl certificate by setting PUFFIN_TEST_CA_CERT_PEM to a pem file, e.g.

PUFFIN_TEST_CA_CERT_PEM=$(pwd)/mitmproxy-ca-cert.pem ./offlinepi record cargo test --features pypi --features puffin-test-custom-ca-cert -- --test-threads=1 

This feature is off by default, so this is not possible in release builds.

Built on #609

When activating the `puffin-test-custom-ca-cert` feature, you can inject a custom ssl certificate by setting `PUFFIN_TEST_CA_CERT_PEM` to a pem file, e.g.

```bash
PUFFIN_TEST_CA_CERT_PEM=$(pwd)/mitmproxy-ca-cert.pem ./offlinepi record cargo test --features pypi --features puffin-test-custom-ca-cert -- --test-threads=1
```

This feature is off by default, so this is not possible in release builds.
@konstin konstin requested a review from zanieb December 12, 2023 10:50
@konstin
Copy link
Member Author

konstin commented Dec 12, 2023

PUFFIN_TEST_CA_CERT_PEM=$(pwd)/mitmproxy-ca-cert.pem ./offlinepi replay cargo test --features pypi --features puffin-test-custom-ca-cert --test resolver

Raises "SIGSEGV: invalid memory reference" 😵‍💫

@konstin konstin marked this pull request as draft December 12, 2023 11:07
@zanieb
Copy link
Member

zanieb commented Dec 12, 2023

Some commentary at #609 (comment)

I like this, but also think we need a user-facing way to use system certs.

@konstin
Copy link
Member Author

konstin commented Dec 12, 2023

I think those are two separate issues; I also wouldn't recommend people to change their system trust store to run puffin unit tests.

@konstin konstin marked this pull request as ready for review December 12, 2023 17:53
@konstin
Copy link
Member Author

konstin commented Dec 12, 2023

I think this PR is fine, but the segfault is a problem in general

@zanieb
Copy link
Member

zanieb commented Dec 12, 2023

Yeah the segfault seems non-deterministic and more likely to occur with parallelism

@zanieb zanieb changed the base branch from main to zb/offlinepi December 14, 2023 18:27
@zanieb zanieb merged commit d397401 into zb/offlinepi Dec 14, 2023
3 checks passed
@zanieb zanieb deleted the konsti/test-certificate branch December 14, 2023 18:27
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.

None yet

2 participants