diff --git a/AUTHORS b/AUTHORS index 80199cf2c..876b2964a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -82,6 +82,7 @@ Reed Allman Richard Wilkes Robert Russell Runrioter Wung +Santhosh Kumar Tekuri Sho Iizuka Sho Ikeda Shuode Li diff --git a/auth.go b/auth.go index b2f19e8f0..f610b5f49 100644 --- a/auth.go +++ b/auth.go @@ -274,7 +274,9 @@ func (mc *mysqlConn) auth(authData []byte, plugin string) ([]byte, error) { if len(mc.cfg.Passwd) == 0 { return []byte{0}, nil } - if mc.cfg.tls != nil || mc.cfg.Net == "unix" { + // unlike caching_sha2_password, sha256_password does not accept + // cleartext password on unix transport. + if mc.cfg.tls != nil { // write cleartext auth packet return append([]byte(mc.cfg.Passwd), 0), nil }