[Java] Desabilitando paliativamente o SSL de uma conexão com o MySQL para evitar o seguinte erro: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify

mysql

** 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:308)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
	at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2249)
	at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4221)
	at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1464)
	at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:135)
	at com.zaxxer.hikari.pool.HikariPool.lambda$closeConnection$1(HikariPool.java:441)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)


** END NESTED EXCEPTION **

Solução paliativa:

Alterar a String de conexão com o banco de dados e adicionar o parametro `useSSL` como false:

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

https://stackoverflow.com/a/55193187/10512799

Solução adequada:

A solução adequada seria configurar sua conexão com o banco de dados de forma segura utilizando o SSL, segue alguns links úteis:

https://www.techrunnr.com/connect-mysql-server-from-spring-boot-application-with-ssl/

https://stackoverflow.com/questions/43635449/how-to-configure-spring-boot-application-to-use-ssl-tls-over-mysql?rq=1