cloud-sql-proxy icon indicating copy to clipboard operation
cloud-sql-proxy copied to clipboard

failed to connect to instance: Dial error: handshake failed... tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

Open rkja22 opened this issue 8 months ago • 1 comments

Facing this error with a cloud sql auth proxy connection. The set up is like this -

  • Cloud SQL Auth proxy is running on a VM in a VPC which is connected to CloudSQL instance via peering (PSA)
  • Cloud SQL has only private IP
  • Tested with both SSL enabled and disabled. Same error.
  • Command used to start the proxy - ./cloud-sql-proxy --address 0.0.0.0 --port 5498 projectname:region:instancename --private-ip

Error seen in proxy logs - failed to connect to instance: Dial error: handshake failed (connection name ="projectname:region:instancename ") tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

rkja22 avatar May 21 '25 14:05 rkja22

Hi there @rkja22, Would you mind sharing which version of the proxy are you using? Also, do you have any of these features enabled on your cloud sql instance: Custom Certificate Authority, Custom Subject Alternative Names, MySQL 8.4, or Managed Read Pool?

hessjcg avatar May 27 '25 15:05 hessjcg

Cloud SQL Proxy Version - 2.14.3+linux.amd64 do you have any of these features enabled on your cloud sql instance: Custom Certificate Authority, Custom Subject Alternative Names, MySQL 8.4, or Managed Read Pool? -- None. Its a Postgres 16, CloudSQL enterprise instance

rkja22 avatar Jul 16 '25 08:07 rkja22

@rkja22 ,

Thanks for the answers. That helps narrow down what might be wrong.

Here are a few things you can try:

Let us know if that worked.

hessjcg avatar Jul 16 '25 15:07 hessjcg

Hi,

Closing this issue for now, please feel free to reopen it with any queries you might have.

kgala2 avatar Sep 09 '25 06:09 kgala2