Mark Williams
Mark Williams

Reputation: 334

Configuring the Postgres client authorisation file for ssl

I wish to set up my PostgreSQL server so that local access is non-SSL and non-local is always SSL. Does the configuration below achieve this?

# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD

# IPv4 local & remote connections:
host    all             all             127.0.0.1/32            trust
hostssl all             all             0.0.0.0/0               md5
# IPv6 local connections:
host    all             all             ::1/128                 trust

Upvotes: 1

Views: 57

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246123

Yes, this pg_hba.conf file will work like you desire.

Upvotes: 1

Related Questions