Solve Error javax.net.ssl.SSLException: Closing inbound before receiving peer’s close_notify

How to solve the java mysql error javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify

While you working on any web application project where we use the MYSQL database to store the information. you might face the error “javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify“.

Let’s understand the reason behind the error and find out a perfect solution for it.

Following are the reasons for the  Error javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify

  • The application is running on localhost.
  • The application is running on a live server without an SSL certificate.
  • Using HTTP not HTTPS

Solve the error:

Mark SSL as false in your database connection URL as shown in the below code.

Add the ?useSSL=false at the end of the database connection URL.

jdbc:mysql://localhost:3306/Schmgt?useSSL=false

Note: if you are using a live server with HTTPS protocol then remove the ?useSSL=false from your database connection URL. Its all about the application security.