rustls / futures-rustls

Apache License 2.0
13 stars 7 forks source link

feat: updates for rustls 0.23 #9

Closed jbr closed 5 months ago

jbr commented 5 months ago

This PR is an attempt at updating futures-rustls for rustls 0.23.

Let me know if you'd like me to split any of these out into distinct PRs or to back them out of this PR.

quininer commented 5 months ago

I hope that futures-rustls and tokio-rustls keep isomorphic in implement to reduce maintenance costs.

You can refer to this to implement it. https://github.com/rustls/tokio-rustls/pull/44

jbr commented 5 months ago

Specifically you mean adding a variant instead of using an option? Will do.

Why don't these crates share code if they're intended to be largely identical? Or have one crate and enable the async traits with a feature flag? Or at the least keep them in a shared workspace folks remember to update both?

I also believe there's a bug in the other implementation, in that it doesn't check if the alert returns WouldBlock and return pending. Should I PR that over there?

jbr commented 5 months ago

Switched to using a MidHandshake::SendAlert variant instead of a MidHandshake::Error { alert: Option<AcceptedAlert>,.. }

jbr commented 5 months ago

@quininer @djc Is this PR good to go? I believe it tracks all of the changes that have been made in tokio-rustls for rustls 0.23

quininer commented 5 months ago

There are some other changes in tokio-rustls (poll_shutdown, vectored write), would you like to work on it in this PR?

jbr commented 5 months ago

@quininer added cb69b96 and 02417c3 with vectored_write and poll_close changes from tokio-rustls

quininer commented 5 months ago

I'll take a look tonight.

quininer commented 5 months ago

Thank you!