From f93201197b7044af468b751832e680ef94e65da0 Mon Sep 17 00:00:00 2001 From: Flamki <9833ayush@gmail.com> Date: Tue, 10 Feb 2026 23:03:31 +0530 Subject: [PATCH] Honor sslmode=disable for db connections --- pkg/pgxv5/connect.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/pgxv5/connect.go b/pkg/pgxv5/connect.go index 4ae754f24..77b62c509 100644 --- a/pkg/pgxv5/connect.go +++ b/pkg/pgxv5/connect.go @@ -18,6 +18,9 @@ func Connect(ctx context.Context, connString string, options ...func(*pgx.ConnCo if err != nil { return nil, errors.Errorf("failed to parse connection string: %w", err) } + if strings.EqualFold(config.RuntimeParams["sslmode"], "disable") { + config.TLSConfig = nil + } config.OnNotice = func(pc *pgconn.PgConn, n *pgconn.Notice) { if !shouldIgnore(n.Message) { fmt.Fprintf(os.Stderr, "%s (%s): %s\n", n.Severity, n.Code, n.Message)