Re: SSL URL

From: Phil Moors <pmoors(at)ncric(dot)com>
To: pgsql-jdbc List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: SSL URL
Date: 2004-07-22 15:14:57
Message-ID: 1090509297.1582.7.camel@pm0
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 2004-07-21 at 16:43, Kris Jurka wrote:

> If this is the only way to do it, then in the 7.4 source tree see
> org/postgresql/jdcb1/AbstractJdbc1Connection.java in the openConnection
> method:
>
> if (info.getProperty("ssl") != null && Driver.sslEnabled())
> {
> useSSL = true;
> }
> else
> {
> useSSL = false;
> }
>

I changed false to true and recompiled. The resulting postgresql.jar
file trips the following errors. I'm using a self signed certificate for
an internal development box. I used the Sun sdk version 1.4.2_05 because
ColdFusion's jre is 1.4.2.

Connection verification failed for data source: dweb
[]java.sql.SQLException: An I/O error has occured while flushing the
output - Exception: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found
Stack Trace: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275) at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at
org.postgresql.core.PGStream.flush(PGStream.java:412) at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1Connection.java:284) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:213) at org.postgresql.Driver.connect(Driver.java:139) at coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysicalConnection(JDBCPool.java:511) at coldfusion.server.j2ee.sql.pool.ConnectionRunner$RunnableConnection.run(ConnectionRunner.java:64) at java.lang.Thread.run(Thread.java:534) 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.java:107) at sun.security.validator.Validator.validate(Validator.java:202) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA6275) at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA6275) ... 16 more End of Stack Trace
The root cause was that: java.sql.SQLException: An I/O error has occured
while flushing the output - Exception:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found
Stack Trace: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at
com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275) at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
at java.io.Buffere...

Phil

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-07-22 15:46:56 Re: SSL URL
Previous Message Tom Lane 2004-07-22 15:13:12 Re: [JDBC] V3 protocol + DECLARE problems