Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in running BTCEAccountInfoDemo #667

Closed
bryan4887 opened this issue Sep 28, 2014 · 3 comments
Closed

Error in running BTCEAccountInfoDemo #667

bryan4887 opened this issue Sep 28, 2014 · 3 comments

Comments

@bryan4887
Copy link
Contributor

Hello,

First of all, thanks for this great set of packages. I'm new to both Java and Maven, so I apologize if this is a noobie problem, but I can't seem to get any of the authenticated methods to work. Below I show the error for the BTCEAccountInfoDemo.

I have tried creating new a new API key and Secret key on the BTC-e.com site, but it doesn't seem to affect anything. Does anyone have any idea about what might be causing this?

Thanks!

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
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.getOutputStream(HttpURLConnection.java:1091)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at si.mazi.rescu.HttpTemplate.send(HttpTemplate.java:124)
at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:120)
at si.mazi.rescu.RestInvocationHandler.prepareAndInvoke(RestInvocationHandler.java:111)
at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:101)
at com.sun.proxy.$Proxy10.getInfo(Unknown Source)
at com.xeiam.xchange.btce.v3.service.polling.BTCEAccountServiceRaw.getBTCEAccountInfo(BTCEAccountServiceRaw.java:37)
at com.xeiam.xchange.btce.v3.service.polling.BTCEAccountService.getAccountInfo(BTCEAccountService.java:31)
at btce.account.BTCEAccountInfoDemo.generic(BTCEAccountInfoDemo.java:30)
at btce.account.BTCEAccountInfoDemo.main(BTCEAccountInfoDemo.java:20)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1323)
... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 26 more

@sutra
Copy link
Contributor

sutra commented Sep 28, 2014

@timmolter
Copy link
Member

You can first try a really simple thing first. Add

CertHelper.trustAllCerts();

to the beginning of your test class. It's not recommended to run that on a production system with real money though. Follow @sutra 's link to install btc-e SSL cert.

@bryan4887
Copy link
Contributor Author

Thanks, Tim and Sutra! CertHelper.trustAllCerts(); did the trick.
So in the production version, I will want to install this btc-e SSL cert via @sutra's link?

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

No branches or pull requests

3 participants