pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres ssl client certificate authentification
2+ messages / 2 participants
[nested] [flat]

* postgres ssl client certificate authentification
@ 2021-10-15 15:32  Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
  0 siblings, 1 reply; 2+ messages in thread

From: Zwettler Markus (OIZ) @ 2021-10-15 15:32 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Hi all,


I am playing around with postgres ssl encryption. I am confused about client certificate authentication:


<quote>
The second approach combines any authentication method for hostssl entries with the verification of client certificates by setting the clientcert authentication option to verify-ca or verify-full. The former option only enforces that the certificate is valid, while the latter also ensures that the cn (Common Name) in the certificate matches the user name or an applicable mapping.
</quote>
https://www.postgresql.org/docs/12/ssl-tcp.html


I tried both configurations within my pg_hba.conf, one after another:
hostssl   all             all             0.0.0.0/0               md5  clientcert=verify-ca
hostssl   all             all             0.0.0.0/0               md5  clientcert=verify-full


Unfortunately, my postgres server doesn't care about any client certificate.
I can do a SSL connection even without any certificate or wrong certificate on the client side (located in the users home directory).


[tstzwma@tstm27373 ~]$ psql 'host=tstm49004 port=5900 dbname=pcl_l222 user=test'
Password:
psql (10.17, server 9.6.21)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

pcl_l222=>


Any idea?


Thanks, Markus

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: postgres ssl client certificate authentification
@ 2021-10-15 15:49  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-10-15 15:49 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

"Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch> writes:
> I am playing around with postgres ssl encryption. I am confused about client certificate authentication:

> <quote>
> The second approach combines any authentication method for hostssl entries with the verification of client certificates by setting the clientcert authentication option to verify-ca or verify-full. The former option only enforces that the certificate is valid, while the latter also ensures that the cn (Common Name) in the certificate matches the user name or an applicable mapping.
> </quote>
> https://www.postgresql.org/docs/12/ssl-tcp.html

Given that your server is 9.6.x, you're reading the wrong version
of the docs.  Per

https://www.postgresql.org/docs/9.6/auth-pg-hba-conf.html

the only clientcert value that does anything is "1":

    In addition to the method-specific options listed below, there is one
    method-independent authentication option clientcert, which can be
    specified in any hostssl record. When set to 1, this option requires
    the client to present a valid (trusted) SSL certificate, in addition
    to the other requirements of the authentication method.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-10-15 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 15:32 postgres ssl client certificate authentification Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2021-10-15 15:49 ` Tom Lane <tgl@sss.pgh.pa.us>

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