Confluence will throw an exception in the catalina.out file while using SSL with MySQL and Java 11
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When running Confluence with MySQL using SSL and Java 11, we will see this error in the catalina.out file:
closing inbound before receiving peer's close_notify
No issues observed while using Confluence.
Environment
- Confluence Server and Data Center 7.1 or later versions
- All versions of MySQL 5.x, 8.0.12 or earlier
- Java 11 – Oracle or AdoptOpenJDK
Diagnosis
- Using Confluence with the aforementioned platforms.
- Find the error message in the catalina.out file inside <confluence-install>/logs folder:
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)
Cause
This problem is caused by a MySQL Bug – https://bugs.mysql.com/bug.php?id=93590
Bug fix
"For an SSL connection, after a client disconnected from a server by calling Connection.close(), the TCP connection remained in the TIME_WAIT state on the server side.
With this fix, the connection remains in the TIME_WAIT state on the client side instead, in most cases."
Solution
We have three options to resolve this bug. Verify if the change can be performed based on the Supported Platforms for your current version of Confluence.
- Upgrade to MySQL 8.0.13 or later versions – Supported in Confluence 7.4.x or later
- Switch from Java 11 to Java 8
Disable SSL by adding the useSSL=false flag in Confluence MySQL URL (confluence.cfg.xml file) – Not recommended