Skip to content

DB SSL mode forcibly downgraded to disable for local connections #77

@poyrazK

Description

@poyrazK

Why is this an issue?

In cmd/clouddns/main.go:85-100, the SSL mode is forcibly set to disable for connections through the Cloud SQL Proxy (127.0.0.1). While the comment claims this is to avoid TLS handshake issues with the local proxy, it means SSL is disabled even when the user explicitly configured sslmode=verify-full.

What is causing it?

q.Set("sslmode", "disable")

This unconditionally overwrites any user-specified SSL mode, including verify-full for production connections.

How can it be solved?

Only disable SSL for the specific case of localhost connections through Cloud SQL Proxy, not for all connections. Check if the host is 127.0.0.1 or localhost before forcing sslmode=disable.

Category

  • Small
  • Medium
  • Large

Severity

  • Low
  • Medium
  • High
  • Critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions