A connection is made with SSL, but always prompts the handshake to fail and the other closes the connection.
Avax.net.ssl.SSLHandshakeException:Remote host closed connection during handshake
At Com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord (Unknown Source)
At Com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake (Unknown Source)
At Com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake (Unknown Source)
At SSL. Httpsclient.main (httpsclient.java:31)
caused By:java.io.EOFException:SSL peer shut down incorrectly
At Com.sun.net.ssl.internal.ssl.InputRecord.read (Unknown Source)
... 4 more
Later found on the Internet is the following reasons:
Sslcontext.getinstance ("TSLv1");(used here to specify security protocols)
The resulting sslcontext are then sslsocketfactory and then Sslsocket.
At this point, the Sslsocket supports multiple versions of SSL, so you need to use
Sslsocket.setenabledprotocols (string[] protocols) specifies the protocol version (the protocol version is specified here)
If this step is missing, the default SSLv2 is used when shaking hands. This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120721/32086.html
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