使用带 SSL 的云 Shell 连接到 Google 云 SQL PostgreSQL?

Connecting to Google Cloud SQL PostgreSQL using Cloud Shell with SSL?

我已经在 Google Cloud SQL 上设置了一个 PostgreSQL 实例,现在已将其设置为仅允许 SSL 连接。我可以通过 psql 从我的工作站连接,也可以从 R Studio 等应用程序连接。

但是我正在尝试通过 GCloud Shell 进行连接,但似乎没有看到任何与 SSL 连接的选项。有 options to manage certifications,我已经创建了另一个客户端密钥并在我的云 shell 帐户中下载了它的文件,我只是没有看到使用它们建立连接的选项。没有它只是告诉我 "No SSL" 连接没有 HBA。

这是我看到的(有些东西被混淆了):

don@cloudshell:~ (xxx)$ gcloud sql connect foo --user=postgres
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [postgres].Password for user postgres:
psql: FATAL:  connection requires a valid client certificate
FATAL:  pg_hba.conf rejects connection for host "a.b.c.d", user "postgres", database "postgres", SSL off

根据Cloud SQL GCP docs

Cloud Shell connections do not support SSL. Connections from Cloud Shell fail if the instance is configured to accept only SSL connections.