pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
“tlsv1 alert unknown ca” with PQconnectdb 2+ messages / 2 participants [nested] [flat]
* “tlsv1 alert unknown ca” with PQconnectdb @ 2021-08-04 14:08 M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> 2021-08-04 17:38 ` Re: “tlsv1 alert unknown ca” with PQconnectdb Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 2+ messages in thread From: M Tarkeshwar Rao @ 2021-08-04 14:08 UTC (permalink / raw) To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; pgsql-general; +Cc: Avinesh Kumar <avinesh.kumar@ericsson.com>; Kirti Dhar Upadhyay K <kirti.k.dhar.upadhyay@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com> Hi all, I made following changes in my Postgres server which means I am enabling one way authentication: (Disabled Mutual authentication. Only client will authenticate server.) hostssl all myuser 0.0.0.0/0 md5 clientcert=0 I am trying psql with following options where I am providing client certificates also. It is connected perfectly. psql "host= 10.10.11.18 sslmode=verify-ca sslrootcert=em-ca-crt.pem sslcert=em-client-crt.pem sslkey=em-client-key.pem port=5433 user=postgres dbname=postgres" Same when we used with C api (PQconnectdb((const char *)str);) it is failing with following error message. “tlsv1 alert unknown ca” <https://serverfault.com/questions/793260/what-does-tlsv1-alert-unknown-ca-mean; Also we tried with Java test program. It is connecting properly. Can you please suggest what could be the reason? Regards Tarkeshwar ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: “tlsv1 alert unknown ca” with PQconnectdb 2021-08-04 14:08 “tlsv1 alert unknown ca” with PQconnectdb M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> @ 2021-08-04 17:38 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-08-04 17:38 UTC (permalink / raw) To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; pgsql-general; Avinesh Kumar <avinesh.kumar@ericsson.com>; Kirti Dhar Upadhyay K <kirti.k.dhar.upadhyay@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com> M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> writes: > I am trying psql with following options where I am providing client certificates also. It is connected perfectly. > psql "host= 10.10.11.18 sslmode=verify-ca sslrootcert=em-ca-crt.pem sslcert=em-client-crt.pem sslkey=em-client-key.pem port=5433 user=postgres dbname=postgres" You do realize that those certificate parameters are path names, right? > Same when we used with C api (PQconnectdb((const char *)str);) it is failing with following error message. > tlsv1 alert unknown ca <https://serverfault.com/questions/793260/what-does-tlsv1-alert-unknown-ca-mean; I think the most likely theory is that libpq is failing to load the root cert because the program's current working directory isn't the same as where you had been running psql. It does look like libpq will complain if the given files aren't readable, so maybe the true situation is that it's finding files by those names but they aren't the right ones. In any case, you generally want to put absolute pathnames into these connection parameters. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-08-04 17:38 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-08-04 14:08 “tlsv1 alert unknown ca” with PQconnectdb M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> 2021-08-04 17:38 ` 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