pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
can't access through SSL
13+ messages / 5 participants
[nested] [flat]

* can't access through SSL
@ 2013-02-22 17:43 Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-22 17:43 UTC (permalink / raw)
  To: pgsql-jdbc

Hello all,

I'm trying to access a postgres database through a java application (tomcat).  This is the only entry I have in pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
hostssl all                           all             127.0.0.1/32            cert

and put the certicate (from /var/lib/postre...../coord/server.crt) in the cacerts under $JAVA_HOME/.......

This is my jdbc URL....
jdbc:postgresql://localhost:5432/testdb&ssl=true

But When I try to create a datasource on tomcat, I get the following error...
"Connection attempt failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off"

Any help is greatly appreciated.

-maz

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-22 17:56 ` Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 20:44   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 20:50   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  0 siblings, 3 replies; 13+ messages in thread

From: Vitalii Tymchyshyn @ 2013-02-22 17:56 UTC (permalink / raw)
  To: Maz Mohammadi <mmohammadi@pentaho.com>; +Cc: pgsql-jdbc

Try jdbc:postgresql://localhost:5432/testdb?ssl=true


2013/2/22 Maz Mohammadi <mmohammadi@pentaho.com>

> Hello all,****
>
> ** **
>
> I’m trying to access a postgres database through a java application
> (tomcat).  This is the only entry I have in pg_hba.conf****
>
> ** **
>
> # TYPE  DATABASE        USER            ADDRESS                 METHOD****
>
> hostssl all                           all             127.0.0.1/32
> cert****
>
> ** **
>
> and put the certicate (from /var/lib/postre…../coord/server.crt) in the
> cacerts under $JAVA_HOME/…….****
>
> ** **
>
> This is my jdbc URL….****
>
> jdbc:postgresql://localhost:5432/testdb&ssl=true****
>
> ** **
>
> But When I try to create a datasource on tomcat, I get the following error…
> ****
>
> “Connection attempt failed: FATAL: no pg_hba.conf entry for host
> "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off”****
>
> ** **
>
> Any help is greatly appreciated.****
>
> ** **
>
> -maz****
>



-- 
Best regards,
 Vitalii Tymchyshyn

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
@ 2013-02-22 20:44   ` Maz Mohammadi <mmohammadi@pentaho.com>
  2 siblings, 0 replies; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-22 20:44 UTC (permalink / raw)
  To: pgsql-jdbc

Thx,  one step closer.

pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>


From: Vitalii Tymchyshyn [mailto:tivv00@gmail.com]
Sent: Friday, February 22, 2013 12:56 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] can't access through SSL

Try jdbc:postgresql://localhost:5432/testdb?ssl=true

2013/2/22 Maz Mohammadi <mmohammadi@pentaho.com<mailto:mmohammadi@pentaho.com>>
Hello all,

I'm trying to access a postgres database through a java application (tomcat).  This is the only entry I have in pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
hostssl all                           all             127.0.0.1/32<http://127.0.0.1/32;            cert

and put the certicate (from /var/lib/postre...../coord/server.crt) in the cacerts under $JAVA_HOME/.......

This is my jdbc URL....
jdbc:postgresql://localhost:5432/testdb&ssl=true

But When I try to create a datasource on tomcat, I get the following error...
"Connection attempt failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off"

Any help is greatly appreciated.

-maz



--
Best regards,
 Vitalii Tymchyshyn

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
@ 2013-02-22 20:50   ` Maz Mohammadi <mmohammadi@pentaho.com>
  2 siblings, 0 replies; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-22 20:50 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

I regenerated some new keys for my postgres server.  I've placed them under /var/lib..../coord and shared them with the datanodes as well.

After adding the certificates to the keystore for my tomcat java application, I get the following error on my server.

LOG:  could not accept SSL connection:  sslv3 alert certificate unkown.

I thought I had to use JDBC 3 for this.

Any ideas?

-maz

From: Maz Mohammadi
Sent: Friday, February 22, 2013 3:45 PM
To: pgsql-jdbc@postgresql.org
Subject: RE: [JDBC] can't access through SSL

Thx,  one step closer.

pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>


From: Vitalii Tymchyshyn [mailto:tivv00@gmail.com]
Sent: Friday, February 22, 2013 12:56 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>
Subject: Re: [JDBC] can't access through SSL

Try jdbc:postgresql://localhost:5432/testdb?ssl=true

2013/2/22 Maz Mohammadi <mmohammadi@pentaho.com<mailto:mmohammadi@pentaho.com>>
Hello all,

I'm trying to access a postgres database through a java application (tomcat).  This is the only entry I have in pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
hostssl all                           all             127.0.0.1/32<http://127.0.0.1/32;            cert

and put the certicate (from /var/lib/postre...../coord/server.crt) in the cacerts under $JAVA_HOME/.......

This is my jdbc URL....
jdbc:postgresql://localhost:5432/testdb&ssl=true

But When I try to create a datasource on tomcat, I get the following error...
"Connection attempt failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off"

Any help is greatly appreciated.

-maz



--
Best regards,
 Vitalii Tymchyshyn

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
@ 2013-02-22 21:32   ` Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2 siblings, 1 reply; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-22 21:32 UTC (permalink / raw)
  To: pgsql-jdbc

Correction...

After double checking the path to java's keystore file, and correcting it...this is the new error.
FATAL:  connection requires a valid client certificate.

Any idea would be greatly appreciated.

-maz

From: Maz Mohammadi
Sent: Friday, February 22, 2013 3:51 PM
To: 'pgsql-jdbc@postgresql.org'
Subject: RE: [JDBC] can't access through SSL

Hello,

I regenerated some new keys for my postgres server.  I've placed them under /var/lib..../coord and shared them with the datanodes as well.

After adding the certificates to the keystore for my tomcat java application, I get the following error on my server.

LOG:  could not accept SSL connection:  sslv3 alert certificate unkown.

I thought I had to use JDBC 3 for this.

Any ideas?

-maz

From: Maz Mohammadi
Sent: Friday, February 22, 2013 3:45 PM
To: pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>
Subject: RE: [JDBC] can't access through SSL

Thx,  one step closer.

pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>


From: Vitalii Tymchyshyn [mailto:tivv00@gmail.com]
Sent: Friday, February 22, 2013 12:56 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>
Subject: Re: [JDBC] can't access through SSL

Try jdbc:postgresql://localhost:5432/testdb?ssl=true

2013/2/22 Maz Mohammadi <mmohammadi@pentaho.com<mailto:mmohammadi@pentaho.com>>
Hello all,

I'm trying to access a postgres database through a java application (tomcat).  This is the only entry I have in pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
hostssl all                           all             127.0.0.1/32<http://127.0.0.1/32;            cert

and put the certicate (from /var/lib/postre...../coord/server.crt) in the cacerts under $JAVA_HOME/.......

This is my jdbc URL....
jdbc:postgresql://localhost:5432/testdb&ssl=true

But When I try to create a datasource on tomcat, I get the following error...
"Connection attempt failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off"

Any help is greatly appreciated.

-maz



--
Best regards,
 Vitalii Tymchyshyn

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-24 04:05     ` Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 19:37       ` Re: [JDBC] can't access through SSL Ray Stell <stellr@vt.edu>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 2 replies; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-24 04:05 UTC (permalink / raw)
  To: pgsql-jdbc; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

I still can't access my SSL enabled server!!!

Is root.crt supposed to be an exact copy of server.crt file which I use in my client's keystore?

I have another observation.  As I start the coordinator node, I don't see any file access to the server.key or server.crt file?  Aren't these files supposed to be read at start up time or at least when I try to make a connection from my java application?

Everything I try create a datasource on tomcat I get the follow error on client and server's console...

FATAL:  connection requires a valid client certificate.

Am I missing something?

-maz

From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Maz Mohammadi
Sent: Friday, February 22, 2013 4:33 PM
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] can't access through SSL

Correction...

After double checking the path to java's keystore file, and correcting it...this is the new error.

FATAL:  connection requires a valid client certificate.

Any idea would be greatly appreciated.

-maz

From: Maz Mohammadi
Sent: Friday, February 22, 2013 3:51 PM
To: 'pgsql-jdbc@postgresql.org'
Subject: RE: [JDBC] can't access through SSL

Hello,

I regenerated some new keys for my postgres server.  I've placed them under /var/lib..../coord and shared them with the datanodes as well.

After adding the certificates to the keystore for my tomcat java application, I get the following error on my server.

LOG:  could not accept SSL connection:  sslv3 alert certificate unkown.

I thought I had to use JDBC 3 for this.

Any ideas?

-maz

From: Maz Mohammadi
Sent: Friday, February 22, 2013 3:45 PM
To: pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>
Subject: RE: [JDBC] can't access through SSL

Thx,  one step closer.

pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>


From: Vitalii Tymchyshyn [mailto:tivv00@gmail.com]
Sent: Friday, February 22, 2013 12:56 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>
Subject: Re: [JDBC] can't access through SSL

Try jdbc:postgresql://localhost:5432/testdb?ssl=true

2013/2/22 Maz Mohammadi <mmohammadi@pentaho.com<mailto:mmohammadi@pentaho.com>>
Hello all,

I'm trying to access a postgres database through a java application (tomcat).  This is the only entry I have in pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
hostssl all                           all             127.0.0.1/32<http://127.0.0.1/32;            cert

and put the certicate (from /var/lib/postre...../coord/server.crt) in the cacerts under $JAVA_HOME/.......

This is my jdbc URL....
jdbc:postgresql://localhost:5432/testdb&ssl=true

But When I try to create a datasource on tomcat, I get the following error...
"Connection attempt failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "progres-xc", database "testdb&ssl=true", SSL off"

Any help is greatly appreciated.

-maz



--
Best regards,
 Vitalii Tymchyshyn

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [JDBC] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-24 19:37       ` Ray Stell <stellr@vt.edu>
  1 sibling, 0 replies; 13+ messages in thread

From: Ray Stell @ 2013-02-24 19:37 UTC (permalink / raw)
  To: Maz Mohammadi <mmohammadi@pentaho.com>; +Cc: pgsql-general@postgresql.org

On Feb 23, 2013, at 11:05 PM, Maz Mohammadi wrote:
>  
> FATAL:  connection requires a valid client certificate. 

I use openssl to verify the chain, I think that would help you know what's going on:

openssl verify -CAfile rootca.crt  user.crt

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [JDBC] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-24 21:36       ` Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-24 22:35         ` Re: [GENERAL] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  1 sibling, 1 reply; 13+ messages in thread

From: Adrian Klaver @ 2013-02-24 21:36 UTC (permalink / raw)
  To: Maz Mohammadi <mmohammadi@pentaho.com>; +Cc: pgsql-jdbc; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On 02/23/2013 08:05 PM, Maz Mohammadi wrote:
> I still can’t access my SSL enabled server!!!
>
> Is root.crt supposed to be an exact copy of server.crt file which I use
> in my client’s keystore?
>
> I have another observation.  As I start the coordinator node, I don’t
> see any file access to the server.key or server.crt file?  Aren’t these
> files supposed to be read at start up time or at least when I try to
> make a connection from my java application?
>
> Everything I try create a datasource on tomcat I get the follow error on
> client and server’s console…
>
> FATAL:  connection requires a valid client certificate.
>
> Am I missing something?

It would seem that from this thread you are working with Postgres-XC not 
Postgres, is that correct?

>
> -maz
>
>

-- 
Adrian Klaver
adrian.klaver@gmail.com


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [GENERAL] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
@ 2013-02-24 22:35         ` Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 01:07           ` Re: [GENERAL] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-24 22:35 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: pgsql-jdbc; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Correct!

I'm new postgresql and I need to figure this out for a client.  I installed a bunch packages on my Ubuntu linux and here I am.  I've learned a lot.  I have 2 datanodes, coordinator + gtm.  

-maz

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com] 
Sent: Sunday, February 24, 2013 4:37 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] [JDBC] can't access through SSL

On 02/23/2013 08:05 PM, Maz Mohammadi wrote:
> I still can't access my SSL enabled server!!!
>
> Is root.crt supposed to be an exact copy of server.crt file which I 
> use in my client's keystore?
>
> I have another observation.  As I start the coordinator node, I don't 
> see any file access to the server.key or server.crt file?  Aren't 
> these files supposed to be read at start up time or at least when I 
> try to make a connection from my java application?
>
> Everything I try create a datasource on tomcat I get the follow error 
> on client and server's console...
>
> FATAL:  connection requires a valid client certificate.
>
> Am I missing something?

It would seem that from this thread you are working with Postgres-XC not Postgres, is that correct?

>
> -maz
>
>

--
Adrian Klaver
adrian.klaver@gmail.com


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [GENERAL] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-24 22:35         ` Re: [GENERAL] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-25 01:07           ` Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-25 01:54             ` Re: [JDBC] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 04:16             ` Re: [JDBC] can't access through SSL Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 2 replies; 13+ messages in thread

From: Adrian Klaver @ 2013-02-25 01:07 UTC (permalink / raw)
  To: Maz Mohammadi <mmohammadi@pentaho.com>; +Cc: pgsql-jdbc; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On 02/24/2013 02:35 PM, Maz Mohammadi wrote:
> Correct!
>
> I'm new postgresql and I need to figure this out for a client.  I installed a bunch packages on my Ubuntu linux and here I am.  I've learned a lot.  I have 2 datanodes, coordinator + gtm.

Some general pointers on helping to figure this out:

1) Postgres-XC != Postgres. It shares a code base but adds more moving 
parts. Along that line, you will need to be more specific about how you 
have setup Postgres-XC and exactly which part is failing? I for one do 
not use it, so I am not really sure what datanodes, coordinator and gmt 
signify. On a related note XC has its own mailing 
list(https://lists.sourceforge.net/lists/listinfo/postgres-xc-general), 
it may turn out there are people there that can answer the question sooner.


2) JDBC. It would seem from this thread and the other that covered this 
topic that JDBC is not really the issue. To make your life simpler I 
would test your setup using psql until you get it running properly, then 
pull in JDBC to see if it adds any problems. Also, it is generally 
considered not good protocol to cross post the same issue to different 
lists.


3) Simple with more detail is better. Create a minimum use case and then 
provide maximum detail of how it was set up and run. For instance:

a) What are the versions of the software?
b) Where is the client being run from?
c) Where is the server?
d) How are both setup?
e) What is being done between the client and the server?
f) What do you expect to happen?
g) What is actually happening?
i) The actual error message(s)?

>
> -maz
>


-- 
Adrian Klaver
adrian.klaver@gmail.com


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [JDBC] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-24 22:35         ` Re: [GENERAL] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 01:07           ` Re: [GENERAL] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
@ 2013-02-25 01:54             ` Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 03:45               ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  1 sibling, 1 reply; 13+ messages in thread

From: Maz Mohammadi @ 2013-02-25 01:54 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Hi Adrian,

Thanks for sharing some pointers with me.  You are right, it's not actually an JDBC driver issue.  I posted it on jdbc, because I'm accessing it from a jdbc client, I thought there might be some security issues with the JDBC driver.

1) I'm running postgres-xc v. 9.1.  I'm "pretty" sure that my postgres setup is correct.  Another person from this distribution list help me a bit.  This test shows me that the ssl is setup correctly on my server...

----------
postgres-xc@adminuser-VirtualBox:~/datanode2$ psql 
psql (PGXC 1.0.0, based on PG 9.1.4)
Type "help" for help.

postgres=# \q
postgres-xc@adminuser-VirtualBox:~/datanode2$ psql -h localhost
psql: FATAL:  connection requires a valid client certificate
FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "postgres-xc", database "postgres", SSL off
postgres-xc@adminuser-VirtualBox:~/datanode2$
------------

2) My client is a tomcat server.  I've placed JDBC3 drivers (jar file) in the WEB-INF lib directory of my webapp. 

3) MY jdbc url is "jdbc:postgresql://localhost:5432:testdb?ssl=true", and believe me.... username and password are correct.

4) Both postgres and tomcat are running on the same machine (an Ubuntu linux virtual box).  

5) when I try to create a JDBC datasource on my tomcat, I enter the JDBC url + user + password, and I'm expecting it to be able to connect to it and at least get a "test successful" but I don't.  I get the error that I sent...
"Connection attempt failed: FATAL: connection requires a valid client certificate"

6) I've also specified the following java options..
-Djavax.net.ssl.trustStore=/home/adminuser/pentaho/keycerts/mazstore -Djavax.net.ssl.trustStorePassword=password

I'll post this on the other distribution list.  BTW, I don't see much in the log files under /var/log directory.

-maz


-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com] 
Sent: Sunday, February 24, 2013 8:08 PM
To: Maz Mohammadi
Cc: pgsql-jdbc@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] [JDBC] can't access through SSL

On 02/24/2013 02:35 PM, Maz Mohammadi wrote:
> Correct!
>
> I'm new postgresql and I need to figure this out for a client.  I installed a bunch packages on my Ubuntu linux and here I am.  I've learned a lot.  I have 2 datanodes, coordinator + gtm.

Some general pointers on helping to figure this out:

1) Postgres-XC != Postgres. It shares a code base but adds more moving parts. Along that line, you will need to be more specific about how you have setup Postgres-XC and exactly which part is failing? I for one do not use it, so I am not really sure what datanodes, coordinator and gmt signify. On a related note XC has its own mailing list(https://lists.sourceforge.net/lists/listinfo/postgres-xc-general),
it may turn out there are people there that can answer the question sooner.


2) JDBC. It would seem from this thread and the other that covered this topic that JDBC is not really the issue. To make your life simpler I would test your setup using psql until you get it running properly, then pull in JDBC to see if it adds any problems. Also, it is generally considered not good protocol to cross post the same issue to different lists.


3) Simple with more detail is better. Create a minimum use case and then provide maximum detail of how it was set up and run. For instance:

a) What are the versions of the software?
b) Where is the client being run from?
c) Where is the server?
d) How are both setup?
e) What is being done between the client and the server?
f) What do you expect to happen?
g) What is actually happening?
i) The actual error message(s)?

>
> -maz
>


--
Adrian Klaver
adrian.klaver@gmail.com


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [JDBC] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-24 22:35         ` Re: [GENERAL] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 01:07           ` Re: [GENERAL] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-25 01:54             ` Re: [JDBC] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
@ 2013-02-25 03:45               ` Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Adrian Klaver @ 2013-02-25 03:45 UTC (permalink / raw)
  To: Maz Mohammadi <mmohammadi@pentaho.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On 02/24/2013 05:54 PM, Maz Mohammadi wrote:
> Hi Adrian,
>
> Thanks for sharing some pointers with me.  You are right, it's not actually an JDBC driver issue.  I posted it on jdbc, because I'm accessing it from a jdbc client, I thought there might be some security issues with the JDBC driver.
>
> 1) I'm running postgres-xc v. 9.1.  I'm "pretty" sure that my postgres setup is correct.  Another person from this distribution list help me a bit.  This test shows me that the ssl is setup correctly on my server...

Which server? As I understand it Postgres-XC can have multiple clusters 
in use, so I am still not sure which one you are connecting to?

>
> ----------
> postgres-xc@adminuser-VirtualBox:~/datanode2$ psql
> psql (PGXC 1.0.0, based on PG 9.1.4)
> Type "help" for help.
>
> postgres=# \q
> postgres-xc@adminuser-VirtualBox:~/datanode2$ psql -h localhost

To make things easier to debug, use explicit options. The above command 
leaves a lot to env variables and hidden configuration. There is a good 
chance you are not connecting the way you think you are.


> psql: FATAL:  connection requires a valid client certificate
> FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "postgres-xc", database "postgres", SSL off
> postgres-xc@adminuser-VirtualBox:~/datanode2$

At this point do none of the Tomcat/JDBC process . Until you solve the 
above, it just gets you to the same error and it confuses the issue.

The first thing to solve is why you are getting two different error 
messages, in particular why it says SSL is off. The second is whether 
the user and database specified in the error are who are trying to 
connect as and the database you are trying to connect to.

Also have you gone through Table 17-3. SSL Server File Usage at link 
below to see if everything is in place:
http://www.postgresql.org/docs/9.2/interactive/ssl-tcp.html

Have you followed Rays suggestion:

'I use openssl to verify the chain, I think that would help you know 
what's going on:

openssl verify -CAfile rootca.crt  user.crt


> ------------
>
> 2) My client is a tomcat server.  I've placed JDBC3 drivers (jar file) in the WEB-INF lib directory of my webapp.
>
> 3) MY jdbc url is "jdbc:postgresql://localhost:5432:testdb?ssl=true", and believe me.... username and password are correct.
>
> 4) Both postgres and tomcat are running on the same machine (an Ubuntu linux virtual box).
>
> 5) when I try to create a JDBC datasource on my tomcat, I enter the JDBC url + user + password, and I'm expecting it to be able to connect to it and at least get a "test successful" but I don't.  I get the error that I sent...
> "Connection attempt failed: FATAL: connection requires a valid client certificate"
>
> 6) I've also specified the following java options..
> -Djavax.net.ssl.trustStore=/home/adminuser/pentaho/keycerts/mazstore -Djavax.net.ssl.trustStorePassword=password
>
> I'll post this on the other distribution list.  BTW, I don't see much in the log files under /var/log directory.
>
> -maz
>

-- 
Adrian Klaver
adrian.klaver@gmail.com


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [JDBC] can't access through SSL
  2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-22 17:56 ` Re: can't access through SSL Vitalii Tymchyshyn <tivv00@gmail.com>
  2013-02-22 21:32   ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 04:05     ` Re: can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-24 21:36       ` Re: [JDBC] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
  2013-02-24 22:35         ` Re: [GENERAL] can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
  2013-02-25 01:07           ` Re: [GENERAL] can't access through SSL Adrian Klaver <adrian.klaver@gmail.com>
@ 2013-02-25 04:16             ` Michael Paquier <michael.paquier@gmail.com>
  1 sibling, 0 replies; 13+ messages in thread

From: Michael Paquier @ 2013-02-25 04:16 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: Maz Mohammadi <mmohammadi@pentaho.com>; pgsql-jdbc; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On Mon, Feb 25, 2013 at 10:07 AM, Adrian Klaver <adrian.klaver@gmail.com>wrote:

> 1) Postgres-XC != Postgres. It shares a code base but adds more moving
> parts. Along that line, you will need to be more specific about how you
> have setup Postgres-XC and exactly which part is failing? I for one do not
> use it, so I am not really sure what datanodes, coordinator and gmt
> signify. On a related note XC has its own mailing list(
> https://lists.sourceforge.net/lists/listinfo/postgres-xc-general), it may
> turn out there are people there that can answer the question sooner.
>
Adrian is right, pgsql-general is not the place where to discuss about bugs
or problems of settings regarding Postgres-XC, so please send your requests
to the ML indicated by Adrian so as to allow the developers there
(including me, being an active member of the XC community) solving your
problem.


> 2) JDBC. It would seem from this thread and the other that covered this
> topic that JDBC is not really the issue. To make your life simpler I would
> test your setup using psql until you get it running properly, then pull in
> JDBC to see if it adds any problems. Also, it is generally considered not
> good protocol to cross post the same issue to different lists.
>
I think honestly that the problem is not JDBC itself, but the way the nodes
in an XC cluster interact...


> 3) Simple with more detail is better. Create a minimum use case and then
> provide maximum detail of how it was set up and run. For instance:
>
> a) What are the versions of the software?
> b) Where is the client being run from?
> c) Where is the server?
> d) How are both setup?
> e) What is being done between the client and the server?
> f) What do you expect to happen?
> g) What is actually happening?
> i) The actual error message(s)?

Yes, answering those questions on the XC mailing list would be better when
you report your problem there.
What is the node type where error happens?
Have you setup the SSL certificates on all the nodes?
Or anything that would help resolving what you see.
Does the error happen when connecting directly to a Datanode?
-- 
Michael

^ permalink  raw  reply  [nested|flat] 13+ messages in thread


end of thread, other threads:[~2013-02-25 04:16 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 17:43 can't access through SSL Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-22 17:56 ` Vitalii Tymchyshyn <tivv00@gmail.com>
2013-02-22 20:44   ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-22 20:50   ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-22 21:32   ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-24 04:05     ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-24 19:37       ` Ray Stell <stellr@vt.edu>
2013-02-24 21:36       ` Adrian Klaver <adrian.klaver@gmail.com>
2013-02-24 22:35         ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-25 01:07           ` Adrian Klaver <adrian.klaver@gmail.com>
2013-02-25 01:54             ` Maz Mohammadi <mmohammadi@pentaho.com>
2013-02-25 03:45               ` Adrian Klaver <adrian.klaver@gmail.com>
2013-02-25 04:16             ` Michael Paquier <michael.paquier@gmail.com>

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