From 9d4d2900d8683e8b3df85d6446a2d99a95e4ef3a Mon Sep 17 00:00:00 2001 From: Jonathan Hess Date: Wed, 27 Aug 2025 15:30:47 -0600 Subject: [PATCH] feat: Add MySQL caching_sha2_password support for the proxy clients using unix sockets. --- internal/proxy/fuse.go | 1 - internal/proxy/fuse_test.go | 1 - internal/proxy/proxy.go | 5 +++++ internal/proxy/proxy_other.go | 1 - internal/proxy/proxy_other_test.go | 1 - internal/proxy/unix.go | 1 - main.go | 1 - 7 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/proxy/fuse.go b/internal/proxy/fuse.go index 748b8400b..da9694fc8 100644 --- a/internal/proxy/fuse.go +++ b/internal/proxy/fuse.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !openbsd && !freebsd -// +build !windows,!openbsd,!freebsd package proxy diff --git a/internal/proxy/fuse_test.go b/internal/proxy/fuse_test.go index 0379c9072..02face315 100644 --- a/internal/proxy/fuse_test.go +++ b/internal/proxy/fuse_test.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !darwin -// +build !windows,!darwin package proxy_test diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index ac4aae83b..69ec48551 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -297,6 +297,11 @@ func dialOptions(c Config, i InstanceConnConfig) []cloudsqlconn.DialOption { default: // assume public IP by default } + if networkType(&c, i) == "unix" { + opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("uds")) + } else { + opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("tcp")) + } return opts } diff --git a/internal/proxy/proxy_other.go b/internal/proxy/proxy_other.go index f6199167b..b3c7180f3 100644 --- a/internal/proxy/proxy_other.go +++ b/internal/proxy/proxy_other.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !openbsd && !freebsd -// +build !windows,!openbsd,!freebsd package proxy diff --git a/internal/proxy/proxy_other_test.go b/internal/proxy/proxy_other_test.go index b3503848a..77d7c21bb 100644 --- a/internal/proxy/proxy_other_test.go +++ b/internal/proxy/proxy_other_test.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package proxy_test diff --git a/internal/proxy/unix.go b/internal/proxy/unix.go index 523c49451..7ecd59517 100644 --- a/internal/proxy/unix.go +++ b/internal/proxy/unix.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package proxy diff --git a/main.go b/main.go index d9188054f..4a73ee881 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package main