Closed silverjam closed 2 years ago
cc @skade
We need this
maybe sth in here can help: https://github.com/tokio-rs/tls/pull/64/files
The stream_good
test can be fixed in a similar fashion to https://github.com/tokio-rs/tls/pull/64/files#diff-b3e359ce37f61d9fd2fc6e31203aea06fc4875e20af0a202ad78126904e1343eR120 . The UnexpectedEof
error originates here: https://docs.rs/rustls/latest/src/rustls/conn.rs.html#235 and needs a little tweaking in Stream
too.
The stream_eof
test is getting a WouldBlock
error from the connection Reader in Stream
, as it didn't see an eof nor received a close notify. This needs to be caught at the Stream
i think, in a similar way as tokio-tls is doing it. Though I am not quite sure about the flags.
I was trying to get both to work, but with little success yet.
Apart from fixing the test behaviour with UnexpectedEof
(terminated TCP connections without properly closed TLS session) I think this upgrade also needs to clarify if UnexpectedEof
should be forwarded to the caller or handled inside async-tls
. (I would prefer the former).
Apart from fixing the test behaviour with
UnexpectedEof
(terminated TCP connections without properly closed TLS session) I think this upgrade also needs to clarify ifUnexpectedEof
should be forwarded to the caller or handled insideasync-tls
. (I would prefer the former).
Agreed, forwarding to the caller seems appropriate (and expected).
I have fixed all the tests in my branch that i based on your work: https://github.com/mfelsche/async-tls/tree/update-rustls
@silverjam feel free to cherry-pick the commits, or do you see another way how to bring the changes back here?
@silverjam anything i can do to bring this forward? Should i take over and create a new PR from your and my commits?
@silverjam anything i can do to bring this forward? Should i take over and create a new PR from your and my commits?
I don't have the time to work on this at the moment so happy to hand off to you! Thank you.
I created a new PR #48 that obsoletes this one and contains your commits @silverjam Thanks for starting this!
Just what the title says. Attempted to port to rustls 0.20 (should close #45) -- got (most) things compiling but tests are not happy.
Digging further, the
stream_good
test seems to have issues with handshaking, so it throws an early EOF: