Received fatal alert: handshake_failure through SSLHandshakeException
Received fatal alert: handshake_failure is an error message that can occur during an SSL/TLS handshake.
Received fatal alert: handshake_failure is an error message that can occur during an SSL/TLS handshake. It usually indicates that there is a problem with the SSL/TLS configuration of the client or server, or that there is a mismatch between the SSL/TLS settings of the client and server.
This error can occur when you are trying to establish a secure connection using SSL/TLS, for example when you are trying to connect to an HTTPS website or an LDAPS server. It can have various causes, such as:
- The client and server are using incompatible SSL/TLS protocols (e.g., one supports only TLS 1.2 while the other requires TLS 1.3).
- The client and server are using different cipher suites.
- The client or server has an untrusted, expired, or incorrectly chained SSL/TLS certificate.
- The client or server has an outdated or insecure SSL/TLS implementation.
To troubleshoot this error, you can try the following:
- Ensure that the client and server are using compatible SSL/TLS protocols and cipher suites.
- Verify the SSL/TLS certificate chain on both sides to ensure all intermediate certificates are present and trusted.
- Update the Java Runtime Environment (JRE) or application dependencies to support modern TLS standards.
It might also be helpful to enable SSL/TLS debugging, as this can provide more information about the cause of the error. In Java, you can enable SSL/TLS debugging by setting the javax.net.debug system property to all.
Via command line:
java -Djavax.net.debug=all -jar your-app.jarIn application code:
System.setProperty("javax.net.debug", "all");