Recently, there is a business of communication mode for HTTPS two-way authentication, and then very adept to generate the HTTPS certificate, and then fell into the pit.
In the code debugging, encountered an error sslhandshakeexception:remote host closed connection during handshake
Then there is the TSL protocol version on the web, or the OpenSSL, JDK, tomcat version is wrong, and so on. Then is the constant replacement of parameters, replacement version, change the environment, but the problem has not been resolved.
At this time, I have a feeling that the solution to the problem may not be the right direction. Then we started looking for the problem in other directions, and then after testing, I found the nature of the problem--- validity of the certificate
The newly generated certificate, the validity period is calculated from the second day, so, when used immediately, will report Sslhandshakeexception:remote host closed connection during handshake. But this error, and no hint of specific errors, let developers around a great circle. So, it's important to be able to write the prepared error message and the error-tracking information.
How to solve the problem that just generated the certificate is not valid, an easy way is to change the local system time to tomorrow, and then you can test the pass (if the certificate itself is not a problem)