Prashant Zombade
Prashant Zombade

Reputation: 482

Not able to configure hashicorp-vault with Postgres database

I want to generate postgres credentials/tokens dynamically using hashicorp-vault. For that I am referring https://www.vaultproject.io/docs/secrets/databases/postgresql.html .

Here is the command to configure the plugin:

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"

However following error is thrown

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

Can you guys help me in resolving the error?

Note: Mine is dev server hence the SSL is not enabled. I don't know how to enable that.

Upvotes: 2

Views: 2612

Answers (1)

Amityo
Amityo

Reputation: 6311

You can add ?sslmode=disable to your connection_url. For example -

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

You can read about more ssl configuration here

But, even if you are running a development db you should consider using ssl.

Upvotes: 5

Related Questions