Skip to content

Commit

Permalink
crypto/tls: include close notify in client tls test recordings
Browse files Browse the repository at this point in the history
This commit fixes the issue where tls testdata recordings made with the
newer version of the prerecorded tls conversation test harness, doesn't
end up capturing the final close notify message. The fix simply ensures
that the tls.Client closes before the recording of the conversation is
closed. The closing of the client connection directly is no longer
needed when updating the recording since it will be closed when the
tls.Client is closed.

Fixes golang/go#69846

Change-Id: I93898de32abd89659a32ed240df6daea5aeaa7fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/620395
Reviewed-by: Michael Knyszek <[email protected]>
Reviewed-by: Filippo Valsorda <[email protected]>
Auto-Submit: Filippo Valsorda <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
rygrange authored and gopherbot committed Oct 16, 2024
1 parent c556137 commit 2811331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handshake_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (test *clientTest) run(t *testing.T, write bool) {
}

if write {
clientConn.Close()
client.Close()
path := test.dataPath()
out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
Expand Down

0 comments on commit 2811331

Please sign in to comment.