pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@eulerto.com>
To: Yongqian Li <yongqli@kerrmetric.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Unexpected behavior from using default config value
Date: Wed, 01 Sep 2021 14:19:49 -0300
Message-ID: <de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com> (raw)
In-Reply-To: <CAKF_vo5gXBvqji6JcWNcK9VmBx=3vFC32pUBKgXCnntyQ7y8hw@mail.gmail.com>
References: <CAKF_vo5gXBvqji6JcWNcK9VmBx=3vFC32pUBKgXCnntyQ7y8hw@mail.gmail.com>

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/

view thread (4+ messages)  latest in thread

Message-ID: <de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com>
Permalink:  ../de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com/
Also on:    postgresql.org/message-id/de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: euler@eulerto.com, yongqli@kerrmetric.com
  Subject: Re: Unexpected behavior from using default config value
  In-Reply-To: <de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com>
  References: <CAKF_vo5gXBvqji6JcWNcK9VmBx=3vFC32pUBKgXCnntyQ7y8hw@mail.gmail.com> <de9284d9-eab7-4f51-8164-512027ed56ce@www.fastmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox