Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Mar 11, 2024
1 parent 3d0d418 commit 31b8b38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,17 @@ func (mc *mysqlConn) readHandshakePacket() (data []byte, plugin string, err erro
return nil, "", ErrOldProtocol
}

// TODO(methane): writing to mc.cfg.XXX is bad idea. Fix it later.
if mc.flags&clientSSL == 0 && mc.cfg.TLS != nil {
if mc.cfg.AllowFallbackToPlaintext {
mc.cfg.TLS = nil
} else {
return nil, "", ErrNoTLS
}
}
if mc.flags&clientCompress == 0 {
mc.cfg.compress = false
}

pos += 2

Expand Down

0 comments on commit 31b8b38

Please sign in to comment.