pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedConnection string parameter "sslrootcert" does not work
18+ messages / 7 participants
[nested] [flat]
* Connection string parameter "sslrootcert" does not work
@ 2014-11-11 00:25 Ed Hutchinson <edhutch1963@gmail.com>
2014-11-11 15:10 ` Re: Connection string parameter "sslrootcert" does not work Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 18+ messages in thread
From: Ed Hutchinson @ 2014-11-11 00:25 UTC (permalink / raw)
To: pgsql-odbc
Hi,
I am using the psqlODBC driver to connect to Amazon RDS. I am able to
connect successfully after enabling SSL encryption via the connection
string parameter "sslmode=require". I want to now enable verification of
server identity too, which means that I need to provide the CA certificate
path to the Postgres driver. I tried the connection parameters
"sslmode=verify-full;sslrootcert=<path to CA file>", but the driver is not
able to pick up the file from the specified path (I tried on Windows and
Mac OS X). Things work, however, when the certificate is placed in the
default place the driver looks in - %APPDATA%\Roaming\postgresql\root.crt
on Windows; ~/.postgresql/root.crt on Mac.
Is this a bug that needs to be fixed or am I doing something wrong? I
am using psqlodbc version 09_03_0300-1.
Thanks,
Ed
The resources I consulted:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.Gener...
http://www.postgresql.org/docs/9.3/static/libpq-ssl.html
http://www.postgresql.org/docs/9.3/static/libpq-connect.html
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Connection string parameter "sslrootcert" does not work
2014-11-11 00:25 Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
@ 2014-11-11 15:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-11 17:52 ` Re: Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
0 siblings, 1 reply; 18+ messages in thread
From: Adrian Klaver @ 2014-11-11 15:10 UTC (permalink / raw)
To: Ed Hutchinson <edhutch1963@gmail.com>; pgsql-odbc
On 11/10/2014 04:25 PM, Ed Hutchinson wrote:
> Hi,
> I am using the psqlODBC driver to connect to Amazon RDS. I am able
> to connect successfully after enabling SSL encryption via the connection
> string parameter "sslmode=require". I want to now enable verification of
> server identity too, which means that I need to provide the CA
> certificate path to the Postgres driver. I tried the connection
> parameters "sslmode=verify-full;sslrootcert=<path to CA file>", but the
> driver is not able to pick up the file from the specified path (I tried
> on Windows and Mac OS X). Things work, however, when the certificate is
> placed in the default place the driver looks in -
> %APPDATA%\Roaming\postgresql\root.crt on Windows; ~/.postgresql/root.crt
> on Mac.
>
> Is this a bug that needs to be fixed or am I doing something wrong?
> I am using psqlodbc version 09_03_0300-1.
Not sure, how are you specifying the path to the certificate?
>
> Thanks,
> Ed
>
> The resources I consulted:
> http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.Gener...
> http://www.postgresql.org/docs/9.3/static/libpq-ssl.html
> http://www.postgresql.org/docs/9.3/static/libpq-connect.html
--
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
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Connection string parameter "sslrootcert" does not work
2014-11-11 00:25 Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
2014-11-11 15:10 ` Re: Connection string parameter "sslrootcert" does not work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2014-11-11 17:52 ` Ed Hutchinson <edhutch1963@gmail.com>
2014-11-12 00:59 ` Re: Connection string parameter "sslrootcert" does not work Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-12 03:36 ` Re: Connection string parameter "sslrootcert" does not work Inoue, Hiroshi <inoue@tpf.co.jp>
0 siblings, 2 replies; 18+ messages in thread
From: Ed Hutchinson @ 2014-11-11 17:52 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-odbc
Thanks, Adrian.
Sorry, I should have provided more details.
1) Using this connection string on Windows:
DRIVER={PostgreSQL Unicode};DATABASE=dbedhTest;SERVER=
edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
;UID=MyUser;PWD=********;PORT=5432;BOOLSASCHAR=0;LFCONVERSION=0;UseDeclareFetch=1;sslmode=verify-full;sslrootcert=D:\\temp\\rds-ssl-ca-cert.pem
I get back:
root certificate file
\"C:\\Users\\edhutch\\AppData\\Roaming/postgresql/root.crt\" does not
exist\nEither provide the file or change sslmode to disable server
certificate verification.
2) Using this connection string on Windows:
DRIVER={PostgreSQL Unicode};DATABASE=dbedhTest;SERVER=
edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
;UID=MyUser;PWD=********;PORT=5432;BOOLSASCHAR=0;LFCONVERSION=0;UseDeclareFetch=1;sslmode=verify-full;sslrootcert=D:/temp/rds-ssl-ca-cert.pem
I get back the same error:
root certificate file
\"C:\\Users\\edhutch\\AppData\\Roaming/postgresql/root.crt\" does not
exist\nEither provide the file or change sslmode to disable server
certificate verification.
3) Using this connection string on Mac OS X:
DRIVER={PostgreSQL Unicode};DATABASE=dbedhTest;SERVER=
edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
;UID=MyUser;PWD=********;PORT=5432;BOOLSASCHAR=0;LFCONVERSION=0;UseDeclareFetch=1;sslmode=verify-full;sslrootcert=/Users/edhutch/temp/rds-ssl-ca-cert.pem
I get back:
root certificate file \"/Users/edhutch/.postgresql/root.crt\" does not
exist\nEither provide the file or change sslmode to disable server
certificate verification.
When I rename the pem file to root.crt and place it in the default location
that the driver expects, the connection goes through fine.
On Tue, Nov 11, 2014 at 7:10 AM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> On 11/10/2014 04:25 PM, Ed Hutchinson wrote:
>
>> Hi,
>> I am using the psqlODBC driver to connect to Amazon RDS. I am able
>> to connect successfully after enabling SSL encryption via the connection
>> string parameter "sslmode=require". I want to now enable verification of
>> server identity too, which means that I need to provide the CA
>> certificate path to the Postgres driver. I tried the connection
>> parameters "sslmode=verify-full;sslrootcert=<path to CA file>", but the
>> driver is not able to pick up the file from the specified path (I tried
>> on Windows and Mac OS X). Things work, however, when the certificate is
>> placed in the default place the driver looks in -
>> %APPDATA%\Roaming\postgresql\root.crt on Windows; ~/.postgresql/root.crt
>> on Mac.
>>
>> Is this a bug that needs to be fixed or am I doing something wrong?
>> I am using psqlodbc version 09_03_0300-1.
>>
>
> Not sure, how are you specifying the path to the certificate?
>
>
>
>> Thanks,
>> Ed
>>
>> The resources I consulted:
>> http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/
>> CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL
>> http://www.postgresql.org/docs/9.3/static/libpq-ssl.html
>> http://www.postgresql.org/docs/9.3/static/libpq-connect.html
>>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Connection string parameter "sslrootcert" does not work
2014-11-11 00:25 Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
2014-11-11 15:10 ` Re: Connection string parameter "sslrootcert" does not work Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-11 17:52 ` Re: Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
@ 2014-11-12 00:59 ` Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 0 replies; 18+ messages in thread
From: Adrian Klaver @ 2014-11-12 00:59 UTC (permalink / raw)
To: Ed Hutchinson <edhutch1963@gmail.com>; +Cc: pgsql-odbc
On 11/11/2014 09:52 AM, Ed Hutchinson wrote:
> Thanks, Adrian.
>
>
> Sorry, I should have provided more details.
>
> I get back:
> root certificate file \"/Users/edhutch/.postgresql/root.crt\" does not
> exist\nEither provide the file or change sslmode to disable server
> certificate verification.
Have you tried doing a psql connection using a redirected sslrootcert to
determine if this a more general problem?
Have you tried to quote the path names?
>
> When I rename the pem file to root.crt and place it in the default
> location that the driver expects, the connection goes through fine.
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
>
--
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
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Connection string parameter "sslrootcert" does not work
2014-11-11 00:25 Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
2014-11-11 15:10 ` Re: Connection string parameter "sslrootcert" does not work Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-11 17:52 ` Re: Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
@ 2014-11-12 03:36 ` Inoue, Hiroshi <inoue@tpf.co.jp>
1 sibling, 0 replies; 18+ messages in thread
From: Inoue, Hiroshi @ 2014-11-12 03:36 UTC (permalink / raw)
To: Ed Hutchinson <edhutch1963@gmail.com>; Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-odbc
(2014/11/12 2:52), Ed Hutchinson wrote:
> Thanks, Adrian.
>
>
> Sorry, I should have provided more details.
>
> 1) Using this connection string on Windows:
> DRIVER={PostgreSQL
> Unicode};DATABASE=dbedhTest;SERVER=edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
> <http://edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com>;UID=MyUser;PWD=********;PORT=5432;...:\\temp\\rds-ssl-ca-cert.pem
>
> I get back:
> root certificate file
> \"C:\\Users\\edhutch\\AppData\\Roaming/postgresql/root.crt\" does not
> exist\nEither provide the file or change sslmode to disable server
> certificate verification.
>
> 2) Using this connection string on Windows:
> DRIVER={PostgreSQL
> Unicode};DATABASE=dbedhTest;SERVER=edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
> <http://edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com>;UID=MyUser;PWD=********;PORT=5432;...
>
> I get back the same error:
> root certificate file
> \"C:\\Users\\edhutch\\AppData\\Roaming/postgresql/root.crt\" does not
> exist\nEither provide the file or change sslmode to disable server
> certificate verification.
>
> 3) Using this connection string on Mac OS X:
> DRIVER={PostgreSQL
> Unicode};DATABASE=dbedhTest;SERVER=edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com
> <http://edhpostgresql.cn4dj2uqcnwe.us-west-1.rds.amazonaws.com>;UID=MyUser;PWD=********;PORT=5432;...
>
> I get back:
> root certificate file \"/Users/edhutch/.postgresql/root.crt\" does not
> exist\nEither provide the file or change sslmode to disable server
> certificate verification.
>
> When I rename the pem file to root.crt and place it in the default
> location that the driver expects, the connection goes through fine.
Currently there's no option to specify path name.
One way is to set an environment variable PGSSLROOTCERT.
regards,
Hiroshi Inoue
--
I am using the free version of SPAMfighter.
SPAMfighter has removed 12912 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len
Do you have a slow PC? Try a Free scan
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
^ permalink raw reply [nested|flat] 18+ messages in thread
* Connection string parameter sslrootcert does not work
@ 2017-01-18 19:12 Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
0 siblings, 1 reply; 18+ messages in thread
From: Paralkar, Apurva @ 2017-01-18 19:12 UTC (permalink / raw)
To: pgsql-odbc
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
…
I’ve also attached the contents of the mylog and psqlodbc.log files. Note that the log files have been sanitized to remove any sensitive information.
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
The contributor there had mentioned that there was no option to specify path name. Is that still the case? Or has that been corrected? If not, is there a plan to fix it?
Thanks,
Apurva
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
mylog.log (application/octet-stream, 9.6K) download
psqlodbc log (application/octet-stream, 1.4K) download
^ permalink raw reply [nested|flat] 18+ messages in thread
* Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
@ 2017-01-18 19:29 ` Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 2 replies; 18+ messages in thread
From: Apurva Paralkar @ 2017-01-18 19:29 UTC (permalink / raw)
To: pgsql-odbc
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. The contributor there had mentioned that there was no option
to specify path name. Is that still the case?
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
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-18 20:01 ` Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-18 20:05 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
1 sibling, 1 reply; 18+ messages in thread
From: Adrian Klaver @ 2017-01-18 20:01 UTC (permalink / raw)
To: Apurva Paralkar <apurva12mar@gmail.com>; pgsql-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
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2017-01-18 20:05 ` Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:16 ` Re: Fwd: Connection string parameter sslrootcert does not work Lindsay Stevens <lindsay.stevens.au@gmail.com>
2017-01-19 02:08 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
0 siblings, 2 replies; 18+ messages in thread
From: Apurva Paralkar @ 2017-01-18 20:05 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-odbc
Yes, I did. But I need to be able to simultaneously connect to multiple
Postgres instances from the same client, each with its own CA certificate.
Hence the need for a way to specify a file path. Having a single
environment variable does not work for me.
On Wed, Jan 18, 2017 at 12:01 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> 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%2BVLH5TB0rDP
>> F2UaMhjoBCJSJNCeL9NYh6WqEuPUL7w%40mail.gmail.com
>>
>> __ __
>>
>> Is there an update on this?
>>
>>
>> Thanks,____
>>
>> Apurva____
>>
>>
>>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-18 20:05 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-18 20:16 ` Lindsay Stevens <lindsay.stevens.au@gmail.com>
1 sibling, 0 replies; 18+ messages in thread
From: Lindsay Stevens @ 2017-01-18 20:16 UTC (permalink / raw)
To: pgsql-odbc
If you can't patch the driver to add a variable for this parameter, a
workaround I've used before is to set up a launcher script that sets
pgsslrootcert as a process scope environment variable. I used a VBScript
and changed the app shortcut to call the script (on Windows). This should
allow multiple connections.
On 19 Jan 2017 7:05 am, "Apurva Paralkar" <apurva12mar@gmail.com> wrote:
Yes, I did. But I need to be able to simultaneously connect to multiple
Postgres instances from the same client, each with its own CA certificate.
Hence the need for a way to specify a file path. Having a single
environment variable does not work for me.
On Wed, Jan 18, 2017 at 12:01 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> 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=<datab
>> ase-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%2BVLH5TB0rDP
>> F2UaMhjoBCJSJNCeL9NYh6WqEuPUL7w%40mail.gmail.com
>>
>> __ __
>>
>> Is there an update on this?
>>
>>
>> Thanks,____
>>
>> Apurva____
>>
>>
>>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-18 20:05 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-19 02:08 ` Apurva Paralkar <apurva12mar@gmail.com>
2017-01-19 02:34 ` Re: Fwd: Connection string parameter sslrootcert does not work Lindsay Stevens <lindsay.stevens.au@gmail.com>
1 sibling, 1 reply; 18+ messages in thread
From: Apurva Paralkar @ 2017-01-19 02:08 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; lindsay.stevens.au@gmail.com; +Cc: pgsql-odbc
*'If you can't patch the driver to add a variable for this parameter, a
workaround I've used before is to set up a launcher script that sets
pgsslrootcert as a process scope environment variable. I used a VBScript
and changed the app shortcut to call the script (on Windows). This should
allow multiple connections.'*
How easy or difficult is it to patch the driver to add a variable for this
parameter? Does something in the driver inherently prevent us from adding
these parameters?
I had simplified my setup for the sake of the post. In reality, the client
application has a single process which initiates the connections. Once the
connections are tested successfully, it spins multiple processes for
whatever work it is supposed to be doing. Since it's a single process, it
does not make sense to use process scope variables. Also, the idea of
multiple processes to simply test connections seems like an overkill.
On Wed, Jan 18, 2017 at 12:05 PM, Apurva Paralkar <apurva12mar@gmail.com>
wrote:
> Yes, I did. But I need to be able to simultaneously connect to multiple
> Postgres instances from the same client, each with its own CA certificate.
> Hence the need for a way to specify a file path. Having a single
> environment variable does not work for me.
>
> On Wed, Jan 18, 2017 at 12:01 PM, Adrian Klaver <adrian.klaver@aklaver.com
> > wrote:
>
>> 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=<datab
>>> ase-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%2BVLH5TB0rDP
>>> F2UaMhjoBCJSJNCeL9NYh6WqEuPUL7w%40mail.gmail.com
>>>
>>> __ __
>>>
>>> Is there an update on this?
>>>
>>>
>>> Thanks,____
>>>
>>> Apurva____
>>>
>>>
>>>
>>
>> --
>> Adrian Klaver
>> adrian.klaver@aklaver.com
>>
>
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-18 20:05 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-19 02:08 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-19 02:34 ` Lindsay Stevens <lindsay.stevens.au@gmail.com>
0 siblings, 0 replies; 18+ messages in thread
From: Lindsay Stevens @ 2017-01-19 02:34 UTC (permalink / raw)
To: pgsql-odbc
A few years ago I wrote a patch to add a pgservice parameter (link below),
and I'd never written any C before that, so I'd say it's not difficult.
Adding a parameter was more or less a matter of adding to the list of
key/values processed and passed to the libpq connection call. Note that the
patch may not work directly anymore since it's diff'd against a rather old
commit, but it should demonstrate the principle.
https://www.postgresql.org/message-id/attachment/45215/add_service_dsn_parameter.patch
On 19 January 2017 at 13:08, Apurva Paralkar <apurva12mar@gmail.com> wrote:
> *'If you can't patch the driver to add a variable for this parameter, a
> workaround I've used before is to set up a launcher script that sets
> pgsslrootcert as a process scope environment variable. I used a VBScript
> and changed the app shortcut to call the script (on Windows). This should
> allow multiple connections.'*
>
>
> How easy or difficult is it to patch the driver to add a variable for this
> parameter? Does something in the driver inherently prevent us from adding
> these parameters?
> I had simplified my setup for the sake of the post. In reality, the client
> application has a single process which initiates the connections. Once the
> connections are tested successfully, it spins multiple processes for
> whatever work it is supposed to be doing. Since it's a single process, it
> does not make sense to use process scope variables. Also, the idea of
> multiple processes to simply test connections seems like an overkill.
>
> On Wed, Jan 18, 2017 at 12:05 PM, Apurva Paralkar <apurva12mar@gmail.com>
> wrote:
>
>> Yes, I did. But I need to be able to simultaneously connect to multiple
>> Postgres instances from the same client, each with its own CA certificate.
>> Hence the need for a way to specify a file path. Having a single
>> environment variable does not work for me.
>>
>> On Wed, Jan 18, 2017 at 12:01 PM, Adrian Klaver <
>> adrian.klaver@aklaver.com> wrote:
>>
>>> 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=<datab
>>>> ase-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/mes
>>>> sage-id/CAB7nPqSF%2BVLH5TB0rDPF2UaMhjoBCJSJNCeL9NYh6WqEuPUL7
>>>> w%40mail.gmail.com
>>>>
>>>> __ __
>>>>
>>>> Is there an update on this?
>>>>
>>>>
>>>> Thanks,____
>>>>
>>>> Apurva____
>>>>
>>>>
>>>>
>>>
>>> --
>>> Adrian Klaver
>>> adrian.klaver@aklaver.com
>>>
>>
>>
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-21 13:22 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
1 sibling, 1 reply; 18+ messages in thread
From: Inoue, Hiroshi @ 2017-01-21 13:22 UTC (permalink / raw)
To: Apurva Paralkar <apurva12mar@gmail.com>; +Cc: pgsql-odbc
Hi Apurva,
Sorry for the late reply.
On 2017/01/19 4:29, 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?
Yes.
Now I'm planning to introduce a new option which specifies libpq
connection parameters as a conninfo style string
like
pqopt={sslrootcert=... sslcert=...}
.
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
@ 2017-01-23 17:15 ` Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 04:28 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 18+ messages in thread
From: Apurva Paralkar @ 2017-01-23 17:15 UTC (permalink / raw)
To: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>; +Cc: pgsql-odbc
Hi Hiroshi,
Thanks for your response. Can you let me know tentatively when this
parameter will be added? I have some deadlines based on this change. I'd
like to know if I can wait for your changes or if I should work on a patch
myself.
Thanks,
Apurva
On Sat, Jan 21, 2017 at 5:22 AM, Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
wrote:
> Hi Apurva,
>
> Sorry for the late reply.
>
> On 2017/01/19 4:29, 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?
>
>
> Yes.
> Now I'm planning to introduce a new option which specifies libpq
> connection parameters as a conninfo style string
> like
> pqopt={sslrootcert=... sslcert=...}
> .
>
> regards,
> Hiroshi Inoue
>
>
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-24 04:28 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-24 22:47 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
0 siblings, 1 reply; 18+ messages in thread
From: Inoue, Hiroshi @ 2017-01-24 04:28 UTC (permalink / raw)
To: Apurva Paralkar <apurva12mar@gmail.com>; +Cc: pgsql-odbc
Hi Apurva,
On 2017/01/24 2:15, Apurva Paralkar wrote:
> Hi Hiroshi,
>
> Thanks for your response. Can you let me know tentatively when this
> parameter will be added? I have some deadlines based on this change.
> I'd like to know if I can wait for your changes or if I should work on
> a patch myself.
I already changed my local source though I've not tested it sufficiently.
It's in https://github.com/hiinoue/psqlODBC.git in the topic branch pqopt.
However I'm afraid the diff is not applicable to 9.3.0400.
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 04:28 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
@ 2017-01-24 22:47 ` Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 23:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 18+ messages in thread
From: Apurva Paralkar @ 2017-01-24 22:47 UTC (permalink / raw)
To: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>; +Cc: pgsql-odbc
Thanks for making the change, Hiroshi.
We can move to using a different version of the driver. Do you know when
this would be available for use?
Also, if the following string was the current 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>
what should the new connection string look like with your changes?
Thanks,
Apurva
On Mon, Jan 23, 2017 at 8:28 PM, Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
wrote:
> Hi Apurva,
>
> On 2017/01/24 2:15, Apurva Paralkar wrote:
>
> Hi Hiroshi,
>
> Thanks for your response. Can you let me know tentatively when this
> parameter will be added? I have some deadlines based on this change. I'd
> like to know if I can wait for your changes or if I should work on a patch
> myself.
>
>
> I already changed my local source though I've not tested it sufficiently.
> It's in https://github.com/hiinoue/psqlODBC.git
> <https://github.com/ringerc/psqlODBC.git; in the topic branch pqopt.
>
> However I'm afraid the diff is not applicable to 9.3.0400.
>
> regards,
> Hiroshi Inoue
>
>
>
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 04:28 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-24 22:47 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
@ 2017-01-24 23:15 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-25 10:06 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 18+ messages in thread
From: Inoue, Hiroshi @ 2017-01-24 23:15 UTC (permalink / raw)
To: Apurva Paralkar <apurva12mar@gmail.com>; +Cc: pgsql-odbc
Hi Apurva,
On 2017/01/25 7:47, Apurva Paralkar wrote:
> Thanks for making the change, Hiroshi.
> We can move to using a different version of the driver. Do you know
> when this would be available for use?
I would push the change to official git if it is confirmed to be OK.
>
> Also, if the following string was the current 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>
> what should the new connection string look like with your
> changes?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>
Driver={PostgreSQL
Unicode(x64)};Server=<hostname>;Port=<port>;Database=<database-name>;UseDeclareFetch=1;Fetch=10000;Uid=username>;Pwd=****;sslmode=verify-ca;pqopt={sslrootcert=<location
of root.pem file on the client>}
Note that the value of pqopt must be enclosed with braces.
Any libpq connection parameters can be specified in a pqopt option.
regards,
Hiroshi Inoue
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 18+ messages in thread
* Re: Fwd: Connection string parameter sslrootcert does not work
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 04:28 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-24 22:47 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 23:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
@ 2017-01-25 10:06 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 0 replies; 18+ messages in thread
From: Inoue, Hiroshi @ 2017-01-25 10:06 UTC (permalink / raw)
To: Apurva Paralkar <apurva12mar@gmail.com>; +Cc: pgsql-odbc
On 2017/01/25 8:15, Inoue, Hiroshi wrote:
> Hi Apurva,
>
> On 2017/01/25 7:47, Apurva Paralkar wrote:
>> Thanks for making the change, Hiroshi.
>> We can move to using a different version of the driver. Do you know
>> when this would be available for use?
>
> I would push the change to official git if it is confirmed to be OK.
Oops I made a mistake.
You can find the change in https://github.com/hiinoue/psqlODBC.git in
the branch pqopt.
>>
>> Also, if the following string was the current 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>
>> what should the new connection string look like with your
>> changes?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>
>
> Driver={PostgreSQL
> Unicode(x64)};Server=<hostname>;Port=<port>;Database=<database-name>;UseDeclareFetch=1;Fetch=10000;Uid=username>;Pwd=****;sslmode=verify-ca;pqopt={sslrootcert=<location
> of root.pem file on the client>}
>
> Note that the value of pqopt must be enclosed with braces.
> Any libpq connection parameters can be specified in a pqopt option.
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 18+ messages in thread
end of thread, other threads:[~2017-01-25 10:06 UTC | newest]
Thread overview: 18+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11 00:25 Connection string parameter "sslrootcert" does not work Ed Hutchinson <edhutch1963@gmail.com>
2014-11-11 15:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-11 17:52 ` Ed Hutchinson <edhutch1963@gmail.com>
2014-11-12 00:59 ` Adrian Klaver <adrian.klaver@aklaver.com>
2014-11-12 03:36 ` Inoue, Hiroshi <inoue@tpf.co.jp>
2017-01-18 19:12 Connection string parameter sslrootcert does not work Paralkar, Apurva <apurvap@amazon.com>
2017-01-18 19:29 ` Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:01 ` Re: Fwd: Connection string parameter sslrootcert does not work Adrian Klaver <adrian.klaver@aklaver.com>
2017-01-18 20:05 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-18 20:16 ` Re: Fwd: Connection string parameter sslrootcert does not work Lindsay Stevens <lindsay.stevens.au@gmail.com>
2017-01-19 02:08 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-19 02:34 ` Re: Fwd: Connection string parameter sslrootcert does not work Lindsay Stevens <lindsay.stevens.au@gmail.com>
2017-01-21 13:22 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-23 17:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 04:28 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-24 22:47 ` Re: Fwd: Connection string parameter sslrootcert does not work Apurva Paralkar <apurva12mar@gmail.com>
2017-01-24 23:15 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2017-01-25 10:06 ` Re: Fwd: Connection string parameter sslrootcert does not work Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
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