Re: Unexpected behavior from using default config value

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Yongqian Li" <yongqli(at)kerrmetric(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Unexpected behavior from using default config value
Date: 2021-09-01 17:19:49
Message-ID: de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Aug 28, 2021, at 10:04 PM, Yongqian Li wrote:
> I encountered this problem while I was trying to enable SSL on my postgresql server. Since I was satisfied with the default values for the "ssl_key_file" and "ssl_cert_file" settings I chose to not configure them -- I simply turned on "ssl" and copied over the files to the default locations. However, I kept getting certificate errors on the client. Examining the certificate sent by the server using `openssl s_client -starttls postgres -connect "$HOSTNAME:5432"` revealed that the server was sending some auto-generated cert instead of the one in "server.crt". Setting the "ssl_key_file" and "ssl_cert_file" settings explicitly to their default value fixed the problem. From the documentation I would expect that missing values for config keys would fallback to their default value; instead it seems that postgresql has some undocumented fallback behavior in this case.
You didn't provide enough information about this issue. Start with the
following query:

SELECT name,
setting,
SOURCE,
bootval,
resetval,
sourcefile,
sourceline,
pending_restart
FROM pg_settings
WHERE name ~ '^ssl';

What's your Postgres version? What's your OS? Are you using a package? Which
one?

Do the server certificate and private key exist in the server's data directory?

ls -la $PGDATA/server.*

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-09-01 19:00:50 Re: Unexpected behavior from using default config value
Previous Message Tom Lane 2021-09-01 16:39:15 Re: The order of postgresql.conf parameters is potentially confusing. Very minor cosmetic bug or "niggle"!