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.
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.