Thread: BUG #12823: jdbc4.jar caues java.lang.ClassCastException

BUG #12823: jdbc4.jar caues java.lang.ClassCastException

From
Daniel.Warren@gdc4s.com
Date:
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.