Search code examples
postgresqlsslpg-dump

Set sslmode=allow with pg_dump


I need to specify sslmode=allow when using psql to connect to my PostgreSQL DB, like: psql sslmode=allow -h localhost -p 5432 otherwise I get server does not support SSL, but SSL was required

I tried specifying the same option to pg_dump but it doesn't recognize the option.

How do I specify sslmode to pg_dump?


Solution

  • You need to use the environment variable PGSSLMODE like this:

    PGSSLMODE=allow pg_dump -h localhost -p 5432