BUG #12823: jdbc4.jar caues java.lang.ClassCastException - Mailing list pgsql-bugs

From Daniel.Warren@gdc4s.com
Subject BUG #12823: jdbc4.jar caues java.lang.ClassCastException
Date
Msg-id 20150303174506.2546.11348@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      12823
Logged by:          Daniel Warren
Email address:      Daniel.Warren@gdc4s.com
PostgreSQL version: 9.2.0
Operating system:   Linux
Description:

Our SSLSocketFactory. createSocket()  creates
org.mozilla.jss.ssl.SSLSocket.

I had been using the postgresql-9.1-903.jdbc4.jar with no problems.

When I upgraded to postgresql 9.3 with the postgresql-9.3-1102-jdbc4.jar I
started getting the exception
java.lang.ClassCastException: org.mozilla.jss.ssl.SSLSocket cannot be cast
to javax.net.ssl.SSLSocket
    at
org.postgresql.ssl.jdbc4.AbstractJdbc4MakeSSL.convert(AbstractJdbc4MakeSSL.java:117)

It looks in postgresql 9.2 AbstractJdbc4MakeSSL.convert

Socket newConnection = factory.createSocket

was changed to

SSLSocket newConnection = (SSLSocket)factory

which causes the java.lang.ClassCastException.

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #12803: the download link is wrong.
Next
From: Ha Quan Le
Date:
Subject: Re: BUG #12821: Cannot install xlogdump