knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.84k stars 1.94k forks source link

Binance api exception occurred while loading the metadata #2565

Open vajr5 opened 6 years ago

vajr5 commented 6 years ago

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125) 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 java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) at si.mazi.rescu.HttpTemplate.receive(HttpTemplate.java:122) at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:162) at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:119) at com.sun.proxy.$Proxy61.exchangeInfo(Unknown Source) at org.knowm.xchange.binance.service.BinanceBaseService.getExchangeInfo(BinanceBaseService.java:62) at org.knowm.xchange.binance.BinanceExchange.remoteInit(BinanceExchange.java:80) at org.knowm.xchange.BaseExchange.applySpecification(BaseExchange.java:115) at org.knowm.xchange.ExchangeFactory.createExchange(ExchangeFactory.java:128)

zzfire commented 6 years ago

i met the same problem, but in JUNIT testcase it works well, but in a standalone application, it fails all the time. I 'm using jdk1.8u162. after some research, i found this topic:https://stackoverflow.com/questions/30817934/extended-server-name-sni-extension-not-sent-with-jdk1-8-0-but-send-with-jdk1-7/31875805 but i can't fix my problem with that workaround. the error situation is all the same with that thread. First , use "-Djavax.net.debug=all" to trigger the verbose ssl log.

After that, i turned to use BITTREX to replace Binance

The verbose log is the same, ""Extension server_name..." line only presents in junit case, not in my complicated standalone application. BUUUTT, it works, retrieve the ticker data.

i don't know why,,,,,really curious about that