patternsqlMajor
Force PostgreSQL clients to use SSL?
Viewed 0 times
postgresqlsslforceclientsuse
Problem
I have configured
(I.e. does
Are there other ways to ensure that all clients always connect over SSL/TLS?
ssl = on in postgresql.conf (and installed a certificate etcetera). Does this ensure that all clients will always connect over SSL?(I.e. does
ssl = on it make it impossible to connect without SSL encryption?)Are there other ways to ensure that all clients always connect over SSL/TLS?
Solution
ssl = on only enables the possibility of using SSL.To ensure that all clients are using SSL, add
hostssl lines in pg_hba.conf, e.g.,hostssl all all 0.0.0.0/0 md5and remove all
host lines. (Well, maybe keep the ones for localhost.)If the desire is to force the client to send a certificate, then
md5 has to be changed to cert. e.g.,hostssl all all 0.0.0.0/0 certCode Snippets
hostssl all all 0.0.0.0/0 md5hostssl all all 0.0.0.0/0 certContext
StackExchange Database Administrators Q#8580, answer score: 44
Revisions (0)
No revisions yet.