Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

From: Jacob Champion <jchampion(at)timescale(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: thomas(at)habets(dot)se, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Date: 2022-10-25 00:03:23
Message-ID: CAAWbhminr7ArSkKh=FeRMajRf43J0Q-VOG=vE-STCCgi7EAg=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 4, 2021 at 9:14 PM Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> On Tue, Sep 28, 2021 at 02:54:39AM -0700, thomas(at)habets(dot)se wrote:
> > And you say for complex setups. Fair enough. But currently I'd say the
> > default is wrong, and what should be default is not configurable.
>
> Agreed, I think this needs much more discussion and documentation.

I'd like to try to get this conversation started again. To pique
interest I've attached a new version of 0001, which implements
`sslrootcert=system` instead as suggested upthread. In 0002 I went
further and switched the default sslmode to `verify-full` when using
the system CA roots, because I feel pretty strongly that anyone
interested in using public CA systems is also interested in verifying
hostnames. (Otherwise, why make the switch?)

Notes:
- 0001, like Thomas' original patch, uses
SSL_CTX_set_default_verify_paths(). This will load both a default file
and a default directory. This is probably what most people want if
they're using the system roots -- just give me whatever the local
system wants me to use! -- but sslrootcert currently deals with files
only, I think. Is that a problem?
- The implementation in 0002 goes all the way down to
conninfo_add_defaults(). Maybe this is overly complex. Should I just
make sslmode a derived option, via connectOptions2()?

Thanks,
--Jacob

Attachment Content-Type Size
v2-0002-libpq-default-to-verify-full-for-system-CAs.patch text/x-patch 4.7 KB
v2-0001-libpq-add-sslrootcert-system-to-use-default-CAs.patch text/x-patch 8.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-10-25 00:40:21 Re: Crash after a call to pg_backup_start()
Previous Message David G. Johnston 2022-10-24 22:36:10 Re: Question about "compound" queries.