Skip to content

remove reqwest unit tests, dev-dependency#43

Merged
complexspaces merged 1 commit intorustls:mainfrom
cpu:cpu-rm-reqwest-test
Dec 21, 2023
Merged

remove reqwest unit tests, dev-dependency#43
complexspaces merged 1 commit intorustls:mainfrom
cpu:cpu-rm-reqwest-test

Conversation

@cpu
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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.

3 participants