Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Exception in thread "listenMsgMode" blade.kit.http.HttpRequestException: #9

Closed
totemtec opened this issue Aug 1, 2016 · 4 comments
Closed

Comments

@totemtec
Copy link

totemtec commented Aug 1, 2016

Exception in thread "listenMsgMode" blade.kit.http.HttpRequestException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at blade.kit.http.HttpRequest.send(HttpRequest.java:2608)
at me.biezhi.weixin.App.webwxsync(App.java:447)
at me.biezhi.weixin.App$2.run(App.java:572)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:980)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at blade.kit.http.HttpRequest.openOutput(HttpRequest.java:2297)
at blade.kit.http.HttpRequest.send(HttpRequest.java:2605)
... 3 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:505)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:961)
... 13 more

@halcon123
Copy link

login的时候也有这个问题了

2016-08-16 18:51:46,516 INFO [main] me.biezhi.weixin.App | [*] GET https://web2.wechat.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket=BMerIM4UXWbEmxgVN58ReSJf@qrticket_0&uuid=oaQZ6RHUAQ==&lang=zh_CN&scan=1471384300&fun=new
Exception in thread "main" blade.kit.http.HttpRequestException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at blade.kit.http.HttpRequest.code(HttpRequest.java:1059)
at blade.kit.http.HttpRequest.stream(HttpRequest.java:1350)
at blade.kit.http.HttpRequest.buffer(HttpRequest.java:1339)
at blade.kit.http.HttpRequest.body(HttpRequest.java:1260)
at blade.kit.http.HttpRequest.body(HttpRequest.java:1275)
at me.biezhi.weixin.App.login(App.java:182)
at me.biezhi.weixin.App.main(App.java:612)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1885)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1884)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1457)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at blade.kit.http.HttpRequest.code(HttpRequest.java:1057)
... 6 more
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2943)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:291)
at blade.kit.http.HttpRequest.header(HttpRequest.java:1644)
at blade.kit.http.HttpRequest.parameter(HttpRequest.java:1783)
at blade.kit.http.HttpRequest.charset(HttpRequest.java:1890)
... 3 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:505)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
... 15 more

@icaca
Copy link

icaca commented Aug 25, 2016

今天也遇到了这个问题,用了好多方法都没能解决这个问题。用wget抓回来的网页应该是没问题的。

@colordancer
Copy link

在url访问的代码前加上System.setProperty("https.protocols", "TLSv1")

@hellokaton
Copy link
Owner

fix in 4dfed15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants