0

I am trying to connect against Cloud SQL with the Cloud SQL Proxy but the problem is that in my company we use a private VPN to connect to Google Services, so I need to have enable the VPN and their proxy.

When I execute

./cloud_sql_proxy -instances=<CONNECTION-NAME>=tcp:5432

If I use a environment variable to declare the proxy and the user and password, it returns me,

errors parsing config:
    Get "https://sqladmin.googleapis.com/sql/v1beta4/projects/<PROJECT>/instances/<REGION>~<SQL-INSTANCE>?alt=json&prettyPrint=false": proxyconnect tcp: tls: first record does not look like a TLS handshake

And if I delete the environment variable, it returns,

errors parsing config:
    Get "https://sqladmin.googleapis.com/sql/v1beta4/projects/<PROJECT>/instances/<REGION>~<INSTANCE-SQL>?alt=json&prettyPrint=false": dial tcp <IP>:<PORT>: i/o timeout

Anyone resolve to execute the cloud_sql_proxy with another proxy?

ourobor93
  • 372
  • 1
  • 7
  • 21
  • 3
    Port `3307` should be open from your corporate network (egress). See https://stackoverflow.com/a/46396551/7031308. – Donnald Cucharo Jan 12 '21 at 04:59
  • But also for PostgreSQL database? – ourobor93 Jan 12 '21 at 09:13
  • Yes, that port is [used by the Cloud SQL Proxy](https://cloud.google.com/sql/docs/postgres/sql-proxy#troubleshooting) to connect to the proxy server. If that solves the issue, please let us know. – Donnald Cucharo Jan 12 '21 at 09:18
  • I reached to have a connection with the cloud_sql_proxy, but when I try to connect to the proxy to get a connection with the database, now it returns me this console log – ourobor93 Jan 12 '21 at 11:08
  • 2021/01/12 11:38:55 Listening on 127.0.0.1:5432 for 2021/01/12 11:38:55 Ready for new connections 2021/01/12 11:39:02 New connection for "" 2021/01/12 11:39:48 New connection for "" 2021/01/12 11:40:18 couldn't connect to "": dial tcp :3307: connect: operation timed out – ourobor93 Jan 12 '21 at 11:10
  • Could you please share the result of this command "telnet PUBLIC IP 3307"? I want to take a look – Andie Vanille Jan 12 '21 at 23:05

0 Answers0