About the issue of Sslhandshakeexception:remote host closed connection during handshake when sending HTTPS (bidirectional) using httpclient

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.