pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Apurva Paralkar <apurva12mar@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: Re: Fwd: Connection string parameter sslrootcert does not work
Date: Wed, 18 Jan 2017 12:01:52 -0800
Message-ID: <2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com> (raw)
In-Reply-To: <CAEnV6tZMEbmWuALUTBmjNk-q4Av7JHN0x7y9zO8_JdW4rSrPkA@mail.gmail.com>
References: <CCEAEAA1-3B22-4AA2-BA22-C41B6799C908@amazon.com>
	<CAEnV6tZMEbmWuALUTBmjNk-q4Av7JHN0x7y9zO8_JdW4rSrPkA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

On 01/18/2017 11:29 AM, Apurva Paralkar wrote:
> Hi,____
>
> __ __
>
> I'm trying to programmatically connect to an RDS Postgres instance with
> SSL enabled, using the psqlodbc driver (Version:
> postgresql94-odbc-09.03.0400-1PGDG.rhel6.x86_64.rpm). I’m having trouble
> with the sslrootcert parameter.____
>
>
> ____
>
> To enable SSL for a Postgres connection, I appended the following
> parameters to the connection string:____
>
> sslmode=verify-ca;sslrootcert=<location of root certificate on the
> client>____
>
> The root certificate exists as a .pem file.____
>
>
> ____
>
> In addition, I also enabled the debug and comm logs:____
>
> debug=1;commlog=1____
>
>
> ____
>
> The resulting logs showed the following error:____
>
> …____
>
> 00028427: 2017-01-17T21:16:57 [SERVER          ]I:  Going to connect to
> ODBC connection string: Driver={PostgreSQL
> Unicode(x64)};Server=<hostname>;Port=-<port>;Database=<database-name>;UseDeclareFetch=1;Fetch=10000;Uid=<username>;Pwd=****;sslmode=verify-ca;sslrootcert=<location
> of root.pem file on the client>;debug=1;commlog=1____
>
> 00028427: 2017-01-17T21:16:57 [SERVER          ]E:  RetCode: SQL_ERROR
> SqlState: 08001 NativeError: 101 Message: [unixODBC]root certificate
> file "/home/<current-user>/.postgresql/root.crt" does not exist____
>
> Either provide the file or change sslmode to disable server certificate
> verification. [122502] ODBC general error.____
>
> 00028427: 2017-01-17T21:16:57 [SERVER          ]E:  Failed to connect
> [122506] Network error has occurred____
>
> …____
>
>
> ____
>
> Does this mean the driver cannot recognize the sslrootcert parameter
> being passed to it? Why does it still refer to the default location of
> the root certificate? I even tried putting the root certificate in the
> default location, but it still failed with the same error above.____
>
> __ __
>
> I was looking up this issue and found a similar thread that was open 3
> years ago:
> https://www.postgresql.org/message-id/5462D5AA.2040602%40tpf.co.jp
> <https://www.postgresql.org/message-id/5462D5AA.2040602%40tpf.co.jp>._ _The
> contributor there had mentioned that there was no option to specify path
> name. Is that still the case?

In the above did you see the suggestion to use the env variable 
PGSSLROOTCERT?

>
> I found another thread which talked about adding support for the
> sslxxxxxx
> parameters: https://www.postgresql.org/message-id/CAB7nPqSF%2BVLH5TB0rDPF2UaMhjoBCJSJNCeL9NYh6WqEuPUL7w%40mail.g...
>
> __ __
>
> Is there an update on this?
>
>
> Thanks,____
>
> Apurva____
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (18+ messages)  latest in thread

Message-ID: <2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com>
Permalink:  ../2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com/
Also on:    postgresql.org/message-id/2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com

 · 

reply

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-odbc@postgresql.org
  Cc: adrian.klaver@aklaver.com, apurva12mar@gmail.com
  Subject: Re: Fwd: Connection string parameter sslrootcert does not work
  In-Reply-To: <2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com>
  References: <CCEAEAA1-3B22-4AA2-BA22-C41B6799C908@amazon.com> <CAEnV6tZMEbmWuALUTBmjNk-q4Av7JHN0x7y9zO8_JdW4rSrPkA@mail.gmail.com> <2c7d9d2e-065b-d00d-d3e3-cb163fa83323@aklaver.com>

* 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