Skip to main content
This needs bqto Pro.
--endpoint IP:PORT skips the lookup and forwards to that address. Use it for an instance whose private address bqto cannot find, such as one behind a Private Service Connect endpoint that you made yourself.

Rules

  • --endpoint needs an IPv4 address, --region (for the bastion), and --network.
  • On a terminal, it also needs --project. With --no-input, the project falls back to the default project of gcloud.
  • The local port is the remote port plus 10000. Above port 55535, give a local port with -p.
  • The flag gives a plain TCP forward for any --service. The service only names the session. If you leave out --service, it is cloudsql. You get no Kafka proxy and no Cloud Run token.
  • With cloudsql or alloydb, -- CMD gets PGHOST and PGPORT.
  • A profile cannot hold --endpoint. So --save and bqto profile create refuse it. --web refuses it too, because --web needs the Cloud Run service that bqto looks up.

TLS and the hostname

A client that checks the TLS hostname fails on 127.0.0.1, because the certificate names the service, such as api.internal.example.com on an internal load balancer. After the ready line, bqto prints one of these lines. Replace HOST with the name in the certificate. Any other service and port gets no line. For Memorystore with TLS, redis-cli needs --tls --cacert server-ca.pem. It does not check the hostname. Other clients need the same two things:
  • The real name, for the certificate and SNI.
  • 127.0.0.1 with the local port, for the connection.
If a client has no such option, add the line 127.0.0.1 HOST to /etc/hosts and connect to HOST:LOCAL_PORT. If you set -p to the remote port, the address of the client stays the same. On Linux, ports below 1024 need root.

Check the server certificate

sslmode=require encrypts the connection, but it does not check a certificate. Cloud SQL shows how to check the server certificate through the tunnel.