pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: SSL confirmation - (could not accept SSL connection: sslv3 alert certificate unknown )
6+ messages / 3 participants
[nested] [flat]

* Re: SSL confirmation - (could not accept SSL connection: sslv3 alert certificate unknown )
@ 2004-12-06 19:33  Andrew M <andrew@jibeya.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew M @ 2004-12-06 19:33 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

Hi,
after much research to various mail-lists, it seems that there is a bug 
in the beta versions of postgreSQL 8 which is causing the problem. Is 
there anyway to create a SSLv3 specific certificate?

regards

Andrew
On 6 Dec 2004, at 12:28, Kris Jurka wrote:

>
>
> On Mon, 6 Dec 2004, Andrew M wrote:
>
>> jdbc:postgresql://localhost:5432/mydatabase?ssl
>>
>> When I launch Jboss, which handles the connection to postgresql, I get
>> the following error:
>>
>> javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: No trusted certificate 
>> found
>>
>
> Difficult to say.  Perhaps JBoss is deciding to use an alternate
> truststore?  Perhaps it doesn't like your cert setup.  I would suggest
> first running a simple client program to test that it's working first.
> Also adding -Djavax.net.debug=ssl to the java command will help 
> debugging
> ssl problems.
>
> Further the 8.0 JDBC driver can create SSL connnections without doing
> authentication by adding using an additional url parameter:
>
> sslfactory=org.postgresql.ssl.NonValidatingFactory
>
> You should try to get it to authenticate correctly, but this is another
> useful test point.
>
> Kris Jurka
>




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

* Re: SSL confirmation - (could not accept SSL connection:
@ 2004-12-06 19:53  Kris Jurka <books@ejurka.com>
  parent: Andrew M <andrew@jibeya.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Kris Jurka @ 2004-12-06 19:53 UTC (permalink / raw)
  To: Andrew M <andrew@jibeya.com>; +Cc: pgsql-general@postgresql.org



On Mon, 6 Dec 2004, Andrew M wrote:

> after much research to various mail-lists, it seems that there is a bug 
> in the beta versions of postgreSQL 8 which is causing the problem. Is 
> there anyway to create a SSLv3 specific certificate?
> 

How about sharing a little of that research with us.  The whole JDBC 
and SSL setup worked fine for me last time I tested it (mid-October) and I 
have little reason to believe it is broken now.  What "bug" are you 
seeing?

Kris Jurka



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

* Re: SSL confirmation - (could not accept SSL connection:
@ 2004-12-06 20:24  Andrew M <andrew@jibeya.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew M @ 2004-12-06 20:24 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

Kris,
the information I base my statements on is from the mail-list:

http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg10008.html

I can confirm that Jboss does not requested a keystore, and that it is 
the driver which is having a problem with the format of the 
certificate. I can confirm that server.key, server.crt, and root.crt 
need to be placed in the root of data:

/usr/local/pgsql/data

If you remove any of those files from the directory , postgreSQl does 
not startup. This is based on requesting ssl with -l.

The options left are to create an SSLv3 specific certificate, if that 
can be done?? or build version 7.4.* of postgreSQL

Any ideas

regards

Andrew

On 6 Dec 2004, at 19:53, Kris Jurka wrote:

>
>
> On Mon, 6 Dec 2004, Andrew M wrote:
>
>> after much research to various mail-lists, it seems that there is a 
>> bug
>> in the beta versions of postgreSQL 8 which is causing the problem. Is
>> there anyway to create a SSLv3 specific certificate?
>>
>
> How about sharing a little of that research with us.  The whole JDBC
> and SSL setup worked fine for me last time I tested it (mid-October) 
> and I
> have little reason to believe it is broken now.  What "bug" are you
> seeing?
>
> Kris Jurka
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to 
> majordomo@postgresql.org
>




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

* Re: SSL confirmation - (could not accept SSL connection:
@ 2004-12-06 22:31  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew M <andrew@jibeya.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2004-12-06 22:31 UTC (permalink / raw)
  To: Andrew M <andrew@jibeya.com>; +Cc: pgsql-general@postgresql.org

Andrew M <andrew@jibeya.com> writes:
> the information I base my statements on is from the mail-list:

> http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg10008.html

AFAICT that thread describes pilot error compounded by poor error
messages from our SSL code.  The error message problem, at least,
should be fixed in 8.0RC1.  If you can demonstrate a problem in RC1,
let's see specifics.

			regards, tom lane



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

* Re: SSL confirmation - (could not accept SSL connection:
@ 2004-12-06 23:03  Andrew M <andrew@jibeya.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew M @ 2004-12-06 23:03 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

Hi Tom,

below is a breakdown of the problems i am experiencing with SSL

Connection String:

jdbc:postgresql://localhost:5432/mydatabase?ssl

my Driver is:

DriverVersion PostgreSQL 8.0devel JDBC3 with SSL (build 308)

The error message i'm getting is:



Code:


14:12:56,779 WARN  [SettingsFactory] Could not obtain connection  
metadata
org.jboss.util.NestedSQLException: Could not create connection; -  
nested throwable: (org.postgresql.
util.PSQLException: The connection attempt failed.); - nested  
throwable: (org.jboss.resource.JBossRe
sourceException: Could not create connection; - nested throwable:  
(org.postgresql.util.PSQLException
: The connection attempt failed.))
         at  
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperD 
ataSource.java:10
6)
         at  
net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(D 
atasourceConnecti
onProvider.java:59)
         at  
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java: 
73)
         at  
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java: 
1132)
         at  
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav 
a:766)
         at  
org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java: 
476)
         at  
org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:444)
         at  
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupp 
ort.java:271)
         at  
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBean 
Support.java:221)

         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController 
.java:891)
         at $Proxy0.start(Unknown Source)
         at  
org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
         at  
org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
         at  
org.jboss.deployment.MainDeployer.start(MainDeployer.java:927)
         at  
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
         at  
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
         at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at  
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor. 
java:119)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at  
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBea 
nOperationInterce
ptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
         at $Proxy8.deploy(Unknown Source)
         at  
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentSc 
anner.java:305)
         at  
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan 
ner.java:481)
         at  
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doS 
can(AbstractDeplo
ymentScanner.java:204)
         at  
org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(Abst 
ractDeploymentSca
nner.java:277)
         at  
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupp 
ort.java:271)
         at  
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBean 
Support.java:221)

         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController 
.java:891)
         at $Proxy0.start(Unknown Source)
         at  
org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
         at  
org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
         at  
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
         at  
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
         at  
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
         at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at  
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher. 
java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at  
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor. 
java:119)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at  
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBea 
nOperationInterce
ptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at  
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav 
a:242)
         at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at  
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
         at $Proxy5.deploy(Unknown Source)
         at  
org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
         at org.jboss.Main.boot(Main.java:151)
         at org.jboss.Main$1.run(Main.java:405)
         at java.lang.Thread.run(Thread.java:552)
Caused by: org.jboss.resource.JBossResourceException: Could not create  
connection; - nested throwabl
e: (org.postgresql.util.PSQLException: The connection attempt failed.)
         at  
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.crea 
teManagedConnecti
on(LocalManagedConnectionFactory.java:161)
         at  
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.creat 
eConnectionEventL
istener(InternalManagedConnectionPool.java:508)
         at  
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getCo 
nnection(Internal
ManagedConnectionPool.java:207)
         at  
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool 
.getConnection(JB
ossManagedConnectionPool.java:534)
         at  
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedCo 
nnection(BaseConn
ectionManager2.java:396)
         at  
org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConne 
ction(TxConnectio
nManager.java:299)
         at  
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConn 
ection(BaseConnec
tionManager2.java:448)
         at  
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionMa 
nagerProxy.alloca
teConnection(BaseConnectionManager2.java:838)
         at  
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperD 
ataSource.java:10
2)
         ... 98 more
Caused by: org.postgresql.util.PSQLException: The connection attempt  
failed.
         at  
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Connecti 
onFactoryImpl.jav
a:136)
         at  
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.j 
ava:63)
         at  
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connect 
ion.java:117)
         at  
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connect 
ion.java:30)
         at  
org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
         at org.postgresql.Driver.connect(Driver.java:183)
         at  
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.crea 
teManagedConnecti
on(LocalManagedConnectionFactory.java:151)
         ... 106 more
Caused by: javax.net.ssl.SSLHandshakeException:  
sun.security.validator.ValidatorException: No truste
d certificate found
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at  
com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA12275)
         at  
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
         at  
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
         at org.postgresql.core.PGStream.flush(PGStream.java:486)
         at  
org.postgresql.core.v3.ConnectionFactoryImpl.sendStartupPacket(Connectio 
nFactoryImpl.java
:243)
         at  
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Connecti 
onFactoryImpl.jav
a:91)
         ... 112 more
Caused by: sun.security.validator.ValidatorException: No trusted  
certificate found
         at  
sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator 
.java:304)
         at  
sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.ja 
va:107)
         at sun.security.validator.Validator.validate(Validator.java:202)
         at  
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Das 
hoA12275)
         at  
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Das 
hoA12275)
         ... 124 more

I sent this message to the jboss forum and they confirmed that Jboss  
had nothing to do with it:

http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857569#3857569

Just to add, I re-built postgreSQl 7.4.6 and installed the appropriate  
driver and also experienced the same thing with that build, So, either

1. ph_hba or postgresql.conf is incorrect or
2. the certificate has not been specified correctly...

regards


Andrew


On 6 Dec 2004, at 22:31, Tom Lane wrote:

> Andrew M <andrew@jibeya.com> writes:
>> the information I base my statements on is from the mail-list:
>
>> http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg10008.html
>
> AFAICT that thread describes pilot error compounded by poor error
> messages from our SSL code.  The error message problem, at least,
> should be fixed in 8.0RC1.  If you can demonstrate a problem in RC1,
> let's see specifics.
>
> 			regards, tom lane
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>




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

* Re: SSL confirmation - (could not accept SSL connection:
@ 2004-12-06 23:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew M <andrew@jibeya.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2004-12-06 23:19 UTC (permalink / raw)
  To: Andrew M <andrew@jibeya.com>; +Cc: pgsql-general@postgresql.org; pgsql-jdbc

Andrew M <andrew@jibeya.com> writes:
> below is a breakdown of the problems i am experiencing with SSL
> ...
> Caused by: javax.net.ssl.SSLHandshakeException:  
> sun.security.validator.ValidatorException: No truste
> d certificate found

It would appear that either you didn't put a root certificate into the
server's $PGDATA/root.crt file, or the server certificate you put into
$PGDATA/server.crt isn't signed by any of the CAs that the client code
thinks are trusted.  I have no idea where the javax.net.ssl library
looks for trusted certs; possibly you could find someone more clueful
about that on pgsql-jdbc.

			regards, tom lane



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


end of thread, other threads:[~2004-12-06 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-06 19:33 Re: SSL confirmation - (could not accept SSL connection: sslv3 alert certificate unknown ) Andrew M <andrew@jibeya.com>
2004-12-06 19:53 ` Re: SSL confirmation - (could not accept SSL connection: Kris Jurka <books@ejurka.com>
2004-12-06 20:24   ` Re: SSL confirmation - (could not accept SSL connection: Andrew M <andrew@jibeya.com>
2004-12-06 22:31     ` Re: SSL confirmation - (could not accept SSL connection: Tom Lane <tgl@sss.pgh.pa.us>
2004-12-06 23:03       ` Re: SSL confirmation - (could not accept SSL connection: Andrew M <andrew@jibeya.com>
2004-12-06 23:19         ` Re: SSL confirmation - (could not accept SSL connection: Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox