-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
crypto/tls: Conn.Close() does not close connection gracefully #71172
Comments
this sounds like a bug report rather than a proposal. please fill in the bug report template and confirm that it reproduces with the latest version of go (preferably including a reproducer). |
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Use these server code: https://go.dev/play/p/2tEl_4ieY6M and client code: https://go.dev/play/p/2aLxSyTZREF can reproduce the case. If we control close process as following, server will not send RST packet, however, in most of library/framework just call interface (net.Conn) Close function.
|
Proposal Details
We use golang:1.21.3 to develop a websocket server, and deploy it on AWS. And we notice that the RST packets sent from server increased than our old server (which is developed in NodeJS). And we trace the code, find crypto/tls/coon.go: Close() may not close connection gracefully
As following screenshot, it send close notify then close connection directly. Then client send close notify to server, it will cause server response RST packet.
Thus we think that after send close notify, it should wait close notify from other side then close connection. It can prevent RST packet.
The text was updated successfully, but these errors were encountered: