From: Tom Lane <tgl@sss.pgh.pa.us>
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Cc: Avinesh Kumar <avinesh.kumar@ericsson.com>
Cc: Kirti Dhar Upadhyay K <kirti.k.dhar.upadhyay@ericsson.com>
Cc: Neeraj Gupta G <neeraj.g.gupta@ericsson.com>
Subject: Re: “tlsv1 alert unknown ca” with PQconnectdb
Date: Wed, 04 Aug 2021 13:38:41 -0400
Message-ID: <2004795.1628098721@sss.pgh.pa.us> (raw)
In-Reply-To: <AM8PR07MB8229AFC37537B83FE085784CAEF19@AM8PR07MB8229.eurprd07.prod.outlook.com>
References: <AM8PR07MB8229AFC37537B83FE085784CAEF19@AM8PR07MB8229.eurprd07.prod.outlook.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
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, m.tarkeshwar.rao@ericsson.com, avinesh.kumar@ericsson.com, kirti.k.dhar.upadhyay@ericsson.com, neeraj.g.gupta@ericsson.com
Subject: Re: “tlsv1 alert unknown ca” with PQconnectdb
In-Reply-To: <2004795.1628098721@sss.pgh.pa.us>
References: <AM8PR07MB8229AFC37537B83FE085784CAEF19@AM8PR07MB8229.eurprd07.prod.outlook.com> <2004795.1628098721@sss.pgh.pa.us>
* 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