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

Acceptor errors are ignored #90

Open
jparris opened this issue Oct 20, 2023 · 1 comment
Open

Acceptor errors are ignored #90

jparris opened this issue Oct 20, 2023 · 1 comment

Comments

@jparris
Copy link

jparris commented Oct 20, 2023

Hi there,

I wrote a custom acceptor that enforces client hostname checking during mTLS. I noticed in serve that errors from the acceptor are ignored, leading the the socket being closed with out reporting an error back to the client. It would be helpful to report these errors back to the client before closing the connection.

serve in server.rs

 tokio::spawn(async move {
     if let Ok((stream, send_service)) = acceptor.accept(addr_stream, service).await   
     // ^^^^ maybe match on the result and write the error down the socket before closing the connection.
.....
@programatik29
Copy link
Owner

In the case of an error, there is no way to access the socket to write to.

You should be able to write the error to the socket before returning an error from acceptor.

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

No branches or pull requests

2 participants