无法使用Postgres数据库配置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。我不知道如何启用。

您可以将?sslmode=disable添加到连接_url。例如 -

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

您可以在此处阅读更多SSL配置

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

最新更新