简体   繁体   中英

Java Peer Not Authenticated

I'm trying to get OAuth through SoundCloud set up, but I'm having tremendous trouble. My newest issue is this:

I have the user login through a popup window which is connected to SoundCloud. It gives me a back a code once the user logs in. This is all working; however, the next step is failing for me. Once I have the code, I run this snippet of Java code:

URI redir = new URI("http://localhost:9000/auth/soundcloudcapturetoken");
ApiWrapper api = new ApiWrapper(SC_CLIENT_ID, SC_CLIENT_SECRET, redir, null, Env.SANDBOX);
Token authToken = api.authorizationCode(code);

Java fails on the api.authorizationCode(code) line with this error:

SSLPeerUnverifiedException occured : peer not authenticated

I snooped around online, and stumbled upon this post: http://davidjb.com/blog/2012/02/java-http-request-fails-with-javax-net-ssl-sslpeerunverifiedexception-peer-not-authenticated

It suggested that I add the two mentioned certs to my java cacerts file(s). I added the two certificates to both my jdk and jre, but my app still fails with the same error. Is there something I am missing here?

As a side note, I am currently using this api to access SoundCloud: https://github.com/soundcloud/java-api-wrapper

SoundCloud dev here.

Are you trying to use the sandbox (ie connecting to https://api.sandbox-soundcloud.com ) ? If so, I was trying to reproduce your issue and just realised that our certificate for that host expired, we are deploying a new certificate as we speak, really sorry about that.

Also, you can find help from SoundCloud engineers in our mailing list: http://bit.ly/yqcubH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM