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

remove reqwest unit tests, dev-dependency #43

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

cpu
Copy link
Member

@cpu cpu commented Dec 14, 2023

Previously the verification mod had a unit test, can_verify_server_cert, that ensured using the platform verifier with reqwest could be done without error.

The reason for this was that the reqwest API consumes custom verifiers to use with a Rustls client config as &dyn Any inputs, and then downcasts at runtime to the required Arc<dyn ServerCertVerifier> - this means that if rustls-platform-verifier uses a different Rustls version than reqwest a runtime panic would occur.

However, having this unit test in place means we can't update rustls-platform-verifier to a new Rustls release until the reqwest ecosystem first updates. This is suboptimal, as reqwest itself has many dependencies that need similar updates.

This commit removes the unit test. Ensuring the Rustls versions match should be handled by downstream consumers that have chosen to use reqwest. There are other libraries one might use rustls-platform-verifier with, and we shouldn't block useful updates to this crate on reqwest. In general one already has to be careful about mixing/matching Rustls versions across dependencies, the fact that reqwest makes this a runtime concern is unfortunate, but not a great reason to avoid keeping this crate in sync with the rest of the 1st-party Rustls ecosystem.

Previously the `verification` mod had a unit test,
`can_verify_server_cert`, that ensured using the platform verifier with
`reqwest` could be done without error.

The reason for this was that the `reqwest` API consumes custom
verifiers to use with a Rustls client config as `&dyn Any` inputs, and
then downcasts at runtime to the required `Arc<dyn ServerCertVerifier>`
- this means that if `rustls-platform-verifier` uses a different Rustls
version than `reqwest` a runtime panic would occur.

However, having this unit test in place means we can't update
`rustls-platform-verifier` to a new Rustls release until the `reqwest`
ecosystem first updates. This is suboptimal, as `reqwest` itself has
many dependencies that need similar updates.

This commit removes the unit test. Ensuring the Rustls versions match
should be handled by downstream consumers that have chosen to use
`reqwest`. There are other libraries one might use
`rustls-platform-verifier` with, and we shouldn't block useful updates
to this crate on `reqwest`. In general one already has to be careful
about mixing/matching Rustls versions across dependencies, the fact that
`reqwest` makes this a runtime concern is unfortunate, but not a great
reason to avoid keeping this crate in sync with the rest of the Rustls
ecosystem.
@cpu cpu self-assigned this Dec 14, 2023
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not great but I guess it's an improvement.

Copy link
Collaborator

@complexspaces complexspaces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@complexspaces complexspaces merged commit 0479b6e into rustls:main Dec 21, 2023
13 checks passed
@cpu cpu deleted the cpu-rm-reqwest-test branch December 21, 2023 16:49
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

3 participants