无法使用Postgres数据库配置hashicorp-vault

时间:2019-02-18 11:05:24

标签: postgresql hashicorp-vault

我想使用hashicorp-vault动态生成postgres凭证/令牌。为此,我指的是https://www.vaultproject.io/docs/secrets/databases/postgresql.html

以下是配置插件的命令:

vault write database/config/my-postgresql-database \
    plugin_name=postgresql-database-plugin \
    allowed_roles="my-role" \
    connection_url="postgresql://{{username}}:{{password}}@localhost:5432/" \ 
    username="root" \
    password="root"

但是会引发以下错误

* error creating database object: error verifying connection: pq: SSL is not enabled on the server

你们可以帮助我解决错误吗?

注意:我的服务器是开发服务器,因此未启用SSL。我不知道如何启用它。

1 个答案:

答案 0 :(得分:1)

您可以将?sslmode=disable添加到connection_url。例如-

connection_url="postgresql://{{username}}:{{password}}@localhost:5432/postgres?sslmode=disable

您可以了解更多有关SSL配置here

的信息。

但是,即使您正在运行开发数据库,​​也应考虑使用ssl。

相关问题