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

Source: Internet
Author: User

Recently there is a business communication mode for HTTPS bidirectional authentication, and then the very easy to generate the HTTPS certificate, and then fell into the pit.

When debugging the code, encountered an error sslhandshakeexception:remote host closed connection during handshake

Then it is said on the Internet that the TSL protocol version is not correct, or OpenSSL, JDK, Tomcat version is not correct, and so on. Then is the constant change of parameters, change the version, change the environment, but the problem has not been resolved.

This time, I have a hunch that the direction of the problem may not be correct. Then we started looking for problems in other directions, and later tested to find out the nature of the problem--- the validity of the certificate

The newly generated certificate is valid from the next day, so when used immediately, it will be reported Sslhandshakeexception:remote host closed connection during handshake. But this error, and no hint of specific errors, let the developers around a big circle. So, it's important to be able to write the error message and error tracking information.

So how to solve the problem that the certificate is not in the validity period, an easy way is to change the local system time to tomorrow, and then you can pass the test (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.