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

update rustls v0.20.7 -> v0.21.0 #137

Merged
merged 3 commits into from
Mar 30, 2023
Merged

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Mar 22, 2023

Description

This branch updates tokio-rustls to use the freshly released Rustls 0.21.0 release tag.

deps: update to rustls 0.21.0.

This commit updates tokio-rustls to use the freshly released Rustls 0.21.0 release tag, and the rustls-webpki fork of webpki.

tests: improve server wait in early data test.

Previously the test_0rtt test had a hardcoded 1s sleep waiting for an openssl s_server process to become ready.

If 1s waiting wasn't long enough, the test could fail with an error like:

Error: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }

This commit replaces the hardcoded sleep with a sleep loop that gradually increases the delay time up to a fixed maximum. This makes the test run faster when the server is ready quickly and prevents an error if it takes longer than 1s to stabilize.

version: 0.23.4 -> 0.24.0

This commit bumps the tokio-rustls version from 0.23.4 to 0.24.0

cpu added a commit to cpu/hyper-rustls that referenced this pull request Mar 22, 2023
This commit updates hyper-rustls to use a patch to track the
yet-to-be-released 0.21.0 rustls work, both as a direct dependency and
through a WIP upgrade[0] to tokio-rustls.

[0]: tokio-rs/tls#137
@paolobarbolini
Copy link
Contributor

paolobarbolini commented Mar 29, 2023

0.21.0 has just been released

@cpu
Copy link
Contributor Author

cpu commented Mar 29, 2023

Thanks, will update shortly.

@cpu cpu force-pushed the cpu-rustls-0.21.0-prep branch from 131d42b to 4147274 Compare March 29, 2023 18:14
@cpu cpu changed the title WIP: update rustls v0.20.7 -> v0.21.0 update rustls v0.20.7 -> v0.21.0 Mar 29, 2023
@cpu cpu marked this pull request as ready for review March 29, 2023 18:15
@cpu
Copy link
Contributor Author

cpu commented Mar 29, 2023

Thanks, will update shortly.

I've updated this branch to use the released 0.21.0 Rustls tag. It still includes #133, so I think it would be prudent to have that work merged first and I can rebase afterwards.

@djc
Copy link
Contributor

djc commented Mar 29, 2023

Want to add a commit that bumps the version?

@cpu
Copy link
Contributor Author

cpu commented Mar 29, 2023

Want to add a commit that bumps the version?

Done: f82c14e

cpu added a commit to cpu/hyper-rustls that referenced this pull request Mar 29, 2023
This commit updates hyper-rustls to use the freshly released rustls
0.21.0.work.

We also use a patch to pick up a WIP upgrade[0] to tokio-rustls to match
rustls versions there.

[0]: tokio-rs/tls#137
Copy link
Member

@quininer quininer left a comment

Choose a reason for hiding this comment

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

LGTM

@zh-jq
Copy link

zh-jq commented Mar 30, 2023

Replace the webpki dependency with rustls-webpki?

@quininer
Copy link
Member

I think we should remove dependencies and features reexport.

@cpu
Copy link
Contributor Author

cpu commented Mar 30, 2023

Replace the webpki dependency with rustls-webpki?

👍 Done.

I think we should remove dependencies and features reexport.

@quininer I think the features that are re-exported from rustls are probably useful for consumers. Perhaps we could discuss this change separately from the update if its something you could describe in more detail in a separate issue?

@cpu
Copy link
Contributor Author

cpu commented Mar 30, 2023

I added another commit (642bba3) to this branch to fix a flaky test I noticed failed after updating the webpki crate to the rustls fork.

cpu added 3 commits March 30, 2023 11:30
This commit updates tokio-rustls to use the freshly released Rustls
0.21.0 release tag, and the rustls-webpki fork of webpki.
Previously the `test_0rtt` test had a hardcoded 1s sleep waiting for an
`openssl s_server` process to become ready.

If 1s waiting wasn't long enough, the test could fail with an error
like:

```
Error: Os { code: 10061, kind: ConnectionRefused, message: "No
connection could be made because the target machine actively refused
it." }
```

This commit replaces the hardcoded sleep with a sleep loop that
gradually increases the delay time up to a fixed maximum. This makes the
test run faster when the server is ready quickly and prevents an error
if it takes longer than 1s to stabilize.
@cpu cpu force-pushed the cpu-rustls-0.21.0-prep branch from 642bba3 to f82c14e Compare March 30, 2023 15:31
@cpu
Copy link
Contributor Author

cpu commented Mar 30, 2023

cpu force-pushed the cpu-rustls-0.21.0-prep branch from 642bba3 to f82c14e

Rebased to remove the commit touching the security-framework dep now that #133 landed.

@quininer
Copy link
Member

It is not hard for users to import rustls themselves, I think it is not very useful and error-prone to maintain it downstream.

It's good to merge this MR in this way, and we can discuss it in other MRs.

@djc djc merged commit 07e8da6 into tokio-rs:master Mar 30, 2023
@cpu cpu deleted the cpu-rustls-0.21.0-prep branch March 30, 2023 15:53
@bartlomieju
Copy link

Hey folks, thanks for quick turn around on this upgrade. When can we expect a new version be published to crates.io?

@djc
Copy link
Contributor

djc commented Mar 31, 2023

@bartlomieju in the next few days, probably.

@cpu
Copy link
Contributor Author

cpu commented Mar 31, 2023

@bartlomieju It looks like 0.24.0 is available in crates.io now.

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.

7 participants