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

Fix bad assert on alpn_protocols and add tests #160

Merged
merged 1 commit into from
Nov 16, 2021
Merged

Conversation

g2p
Copy link
Contributor

@g2p g2p commented Nov 16, 2021

Remove the second assert added in 54e0757, keep only the first.
Add tests.

An assert was added on WantsProtocols1.wrap_connector which was the wrong place, as we update the alpn_protocols field ourselves before calling wrap_connector.
Asserting on with_tls_config is sufficient, this is the only place ConnectorBuilder(WantsSchemes) is constructed and the builder flow will always go through here.

Add tests for all expected values of alpn_protocols and for the expected panic when trying to force it from outside.

An assert was added on WantsProtocols1.wrap_connector which was the
wrong place, as we update the alpn_protocols field ourselves before
calling wrap_connector.  Asserting on with_tls_config is sufficient,
this is the only place ConnectorBuilder(WantsSchemes) is constructed
and the builder will always pass here.

Add tests for alpn_protocols and the expected panic when trying to force
it from outside.
@djc djc merged commit 17f1668 into rustls:main Nov 16, 2021
@djc
Copy link
Member

djc commented Nov 16, 2021

Thanks for fixing that up!

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