我使用证书身份验证(而不是密码)连接到我的 PostgreSQL 数据库(在 AWS EC2 实例上运行)。我将用来连接到我的一个数据库的 psql 命令的一个示例是:
psql "host=<AWS EC2 instance> user=<db user> sslcert=<path to .crt> sslkey=<path to .key> sslrootcert=<path to .crt> sslmode=require dbname=<db name>"
我希望能够将 Tableau Desktop 连接到我的一个数据库。标准 PostgreSQL 连接器不允许我指定要使用的 SSL 证书(但它确实有一个 Require SSL 复选框——我认为它是用于加密而不是身份验证)。
所以我尝试使用 ODBC 连接器。我做了以下条目:
Connect Using
Driver: PostgreSQL Unicode
Connection Attributes
Server: <AWS EC2 instance>
Port: 5432
Database: <db name>
Username: <db user>
String Extras: sslcert=<path to .crt>; sslkey=<path to .key>; sslrootcert=<path to .crt>; sslmode=require
经过反复试验,我认为 String Extras 需要分号作为分隔符,但我仍然无法连接。我收到错误消息:
An error occurred while communicating with Other Databases (ODBC).
Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.
FATAL: connection requires a valid client certificate
Generic ODBC requires additional configuration. The driver and DSN (data source name) must be installed and configured to match the connection.
Unable to connect to the server "<AWS EC2 instance>" using the driver "PostgreSQL Unicode". Check that the server is running and that you have access privileges to the requested database.
如果有人使用证书身份验证将 Tableau Desktop 连接到 PostgreSQL,并能告诉我我做错了什么,我将非常感激。干杯!