Authentication by client cert does not work
mc3 opened this issue · 6 comments
ajr$ psql -h db2 -p 2222
Timing is on.
SET
Time: 0,578 ms
search_path
erdb, syslog, pki, dd, ext_ip4r, archiveopteryx, public
(1 row)
Time: 0,617 ms
psql (10.3, server 10.5)
SSL connection (protocol: TLSv1.2, cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
operations=# \q
ajr$ PGSSLMODE=require pgmetrics -h db2 -p 2222 -w
pgmetrics: remote error: tls: handshake failure
ajr$
In pg_hba.conf the related line is
hostssl ... cert clientcert=1
Are the env. vars. PGSSLCERT
and PGSSLKEY
set and pointing to valid files?
If not, do the files ~/.postgresql/postgresql.crt
and ~/.postgresql/postgresql.key
exist?
The reason is that the cipher DHE-RSA-AES256-GCM-SHA384
is not supported by pgmetrics. Only the ECDHE-*
variants are supported.
It's not clear why this cipher was chosen by your server. You can try getting PostgreSQL to use ECDHE-RSA-AES256-GCM-SHA384
instead, by including this value in the ssl_ciphers
setting.
pgmetrics is trying to connect without SSL (this is the default behavior). Can you try:
PGSSLMODE=require pgmetrics -h db2 -p 2222 -w -f human operations