Spring Boot: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify Spring Boot: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify mysql mysql

Spring Boot: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify


The SSL connection to the database is failing, try changing your datasource URL to:

spring.datasource.url=jdbc:mysql://localhost:3306/employee_database?useSSL=false


The warning looks like a MySQL driver bug with Java 11 and SSL enabled : https://bugs.mysql.com/bug.php?id=93590
Deactivating encryption because of a driver warning is a bad idea.

Your insertion problem looks more like a classic transaction issue though, I doubt it is related to the SSL warning.


I also faced the same issue.if you look the the stacktrace, it's cleary mentioned what to do -

Sat Mar 16 09:00:01 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting **useSSL=false**, or set **useSSL=true** and provide truststore for server certificate verification.

so after disabling the ssl by making changes in data source url solved the problem -

spring.datasource.url=jdbc:mysql://localhost:3306/security?useSSL=false