SSLexception error in Catalina.out

Hey, I upgraded to Lucee 5.3.3.60-RC last night on my test server to verify it works with OpenJDK 12.0.1 - (It does, yes!)

However, every hour I am getting the following error and this is on a cloud instance that has 0 traffic unless I am working on it. So I assumed this was a new issue. However, looking at my production Catalina.out log, it’s there as well for version 5.3.2.77

Tue Jul 09 03:13:41 EDT 2019 WARN: Caught while disconnecting...

EXCEPTION STACK TRACE:



** BEGIN NESTED EXCEPTION ** 

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:254)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:650)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:629)
	at com.mysql.cj.protocol.a.NativeProtocol.quit(NativeProtocol.java:1319)
	at com.mysql.cj.NativeSession.quit(NativeSession.java:182)
	at com.mysql.cj.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:1750)
	at com.mysql.cj.jdbc.ConnectionImpl.close(ConnectionImpl.java:720)
	at lucee.runtime.db.DatasourceConnectionImpl.close(DatasourceConnectionImpl.java:309)
	at lucee.runtime.db.DCStack.clear(DCStack.java:159)
	at lucee.runtime.db.DCStack.clear(DCStack.java:139)
	at lucee.runtime.db.DatasourceConnectionPool.clear(DatasourceConnectionPool.java:175)
	at lucee.runtime.engine.Controler.control(Controler.java:325)
	at lucee.runtime.engine.Controler.control(Controler.java:236)
	at lucee.runtime.engine.Controler.access$000(Controler.java:60)
	at lucee.runtime.engine.Controler$ControlerThread.run(Controler.java:113)


** END NESTED EXCEPTION **

https://luceeserver.atlassian.net/browse/LDEV-2355

quite a few of the db extensions need updating, i.e mysql and sql server

Dang, Zac beat me to it :slight_smile: That’s a bug in the JDBC driver, which has since been patched in the driver, but Lucee has not yet made that new driver available. You can either disable SSL in your datasource connection or go make some noise on that ticket. Or both :slight_smile:

So, “in the old days” you could get the driver and manually update the file. Is that still possible?

Let me rephrase that - can I swap out

/lucee-server/bundles/com.mysql.cj-8.0.15.jar

with

mysql-connector-java-8.0.16.jar

from MySQL?

Yeah, you could grab the jar, or an OSGI bundle if they have it and then specify the classname or bundle name manually. I think adding an “other” dsn via the web admin only allows class name so it you go the bundle route, you’d probably need to specify the connection in your Application.cfc.

You should be able to grab the mysql-connector-java-8.0.16.jar from Maven and throw it into a quick OSGI bundle and voila!

To make it real easy, you could probably just copy out the .lex from the installed MySQL .15 bundle, open it, replace it with the .16 jar and update the MANIFEST to the new version and then drop it back into Lucee.

There’s not much to those bundles! I’ve made several for older databases we still need to connect to…

That’s kind of what I did.

I downloaded the 8.0.16 jar from MySQL and changed the name to com.mysql.cj-8.0.16, removed the 8.0.15 jar, opened the LEX and changed the versions. Also had to change the versions in the Lucee-server.xml file.

Working on test system with, no errors about SSL.

Of course, doing this for multiple contexts is a bit of a pain, but it avoids a huge log file.

Only thing now is that the Lucee Extension Application information (in Lucee admin) - it shows 8.0.16 but states that it requires 8.0.15.

I left the jar name alone as mysql-connector-java-8.0.16.jar and updated the MANIFEST.

You shouldn’t have to change anything in Lucee-server.xml? If you then just deploy the .lex it should update everything on its own:

No more log files with errors! You can download my version here to try:

mysql-connector-java-8.0.16.lex (2.1 MB)

Sweet! That did the trick!

Is there an easy to follow guide for creating these?

There are dozens of guides if you Google around on creating OSGI packages. But OSGI’ifying a single jar is pretty simple… it’s basically just extra meta-data in the package.

It can get a bit more complex when you are packaging several jars and they have dependencies upon other jars outside of those you wish to package…

Turning it into a Lucee extension is more involved, but not difficult. There are some basic examples in the Lucee docs somewhere…