-
Notifications
You must be signed in to change notification settings - Fork 868
send the TLS alert on handshake errors #1865
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
send the TLS alert on handshake errors #1865
Conversation
|
Thank you for noticing the issue and filing the PR. Regarding your concern, I think that for completeness we need to wait for the write to complete. Otherwise, it is my understanding is that this assert would fail if the user of the socket does not immediately close the connection. Note that we do not require the user to close the connection immediately if TLS handshake fails with an alert. FWIW, the principles behind are:
Does that make sense to you? |
|
A Go test case: If you save it to a file like Against another web server, the output is: Against h2o: |
|
Interestingly, I do not see the error when using master branch (currently at 27f04d8) with openssl 1.1.0d. I see the alert being sent when the TLS connection is being closed, specifically in the following call trace: |
|
Apparently, the behavior of openssl has changed somewhere between 1.1.0d and 1.1.0g. Previously, Current approach of H2O is to repeatedly call The PR changes the approach to emit the alert when handshake fails. It also calls To conclude; let's apply the fix, add tests, and revisit the issue when something breaks. |
Hello,
noticed h2o does not send the TLS alert on handshake errors and instead sends a TCP FIN right away. Perhaps this could cause unexpected results with certain clients: e.g. a scan tool.
Just wondering if the proposed change is sound. Could let it spin once after the flush, which would then exit on
output.bufs.size == 0, but the flagis_completeavoids the additional spin.thanks