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

ntls: Convert WouldBlock to ConnectionFailed #699

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

johan-bjareholt
Copy link
Contributor

When the tls handshake starts and the server doesn't respond, the std::net::TcpStream will return WouldBlock or TimedOut when a read/write times out to the socket, which in turn native_tls will convert to a HandshakeError::WouldBlock.

Solves #686

src/ntls.rs Outdated Show resolved Hide resolved
@johan-bjareholt johan-bjareholt force-pushed the would-block-error branch 3 times, most recently from df21d86 to eb74e99 Compare January 5, 2024 10:11
@johan-bjareholt
Copy link
Contributor Author

The tests were broken on master, fixed it in a seperate commit.

@johan-bjareholt johan-bjareholt force-pushed the would-block-error branch 3 times, most recently from 9d02616 to e7211ff Compare January 5, 2024 10:25
@johan-bjareholt
Copy link
Contributor Author

The tests were broken on master, fixed it in a seperate commit.

Seems to be the same thing as was fixed in #696, but not yet merged.

@algesten
Copy link
Owner

It's merged now, but I'm trying to fix this, so accepting PRs are a bit stalled: #688

When the tls handshake starts and the server doesn't respond, the
std::net::TcpStream will return WouldBlock or TimedOut when a
read/write times out to the socket, which in turn native_tls will
convert to a HandshakeError::WouldBlock. Instead of returning back a
io::Error with no type, return io::Error with kind TimedOut.
@johan-bjareholt
Copy link
Contributor Author

Hello @algesten, could you take a look at this again? Thanks!

@algesten algesten merged commit 55c9b19 into algesten:main Feb 6, 2024
50 checks passed
@algesten
Copy link
Owner

algesten commented Feb 6, 2024

Thanks!

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.

2 participants