Skip to content

Commit 9a03c86

Browse files
committed
Check mysqlConnector.canceled.Value when failed to TLS handshake
1 parent 44553d6 commit 9a03c86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packets.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
352352
// Switch to TLS
353353
tlsConn := tls.Client(mc.netConn, mc.cfg.TLS)
354354
if err := tlsConn.Handshake(); err != nil {
355+
if cerr := mc.canceled.Value(); cerr != nil {
356+
return cerr
357+
}
355358
return err
356359
}
357360
mc.netConn = tlsConn

0 commit comments

Comments
 (0)