-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Ssl err #742
Comments
I have the same problem. I think I managed to throw together an ugly workaround. It could also work as a hint if someone more knowledgeable wants to fix this properly. |
After several days of watching this problem happen, I finally walked through the code enough to understand where it's coming from. Spotify provides a list of viable CDN's, and librespot chooses one at random. audio4-gm-fb.spotifycdn.com uses both the new 'Expires' format, has a bad cert that does not match its name, and can't serve the chunk requests anyway. So even though there have been PR's for both the new Expires format, and work-arounds for the mismatched cert, the only actual solution is to pull it out of the rotation. I'll submit separate PR for this soon but in the meantime I'm using the following workaround in CdnFeedHelper.java:
|
@tagdara Thanks, that change helped me get my Spocon installation working again. I changed the file according to the snippet and then ran a Now playing without issues for a few hours already! |
Just hit this today:
The fix posted by @tagdara works perfectly. openssl s_client -connect audio4-gm-fb.spotifycdn.com:443 -verify_hostname audio4-gm-fb.spotifycdn.com indeed shows a hostname mismatch, I guess spotify pushed something bad to prod. |
I'm sry for the silly question, but I don't know java... |
@Fummowo https://github.com/librespot-org/librespot-java/blob/dev/lib/src/main/java/xyz/gianlu/librespot/audio/cdn/CdnFeedHelper.java it’s pretty close to the top of this file, you’re replacing the body of the method, you can fully replace lines 47-50. I’d make a PR but don’t want to take it from @tagdara within any shorter timeframe |
Thanks for reminding me! I made that pull request this morning. I also added #780 which has my development Dockerfile that I use for compiling librespot-java. I'm not a Java programmer either, although I've been using these changes as an excuse to learn how to do so. |
Since the issues is not closed: This solution works for all (temporary) failures (and recovers after fixed). Roughly, it takes all urls and uses the first (randomly chosen) one which works. Code can be found at https://github.com/notalexa/librespot-java/tree/broken-server-fixes |
Describe the bug
javax.net.ssl.SSLPeerUnverifiedException: Hostname audio4-gm-fb.spotifycdn.com not verified:
certificate: sha256/mikb4l8fq5rYJv+AdSiChROLrTKpCEENcVFH4engaDw=
DN: CN=audio-gm-off.spotifycdn.com
subjectAltNames: [audio-gm-off.spotifycdn.com]
To Reproduce
get track audio
Expected behavior
Can get Audio
Screenshots/Stracktraces/Logs
Version/Commit
xyz.gianlu.librespot:librespot-lib:1.6.3
The text was updated successfully, but these errors were encountered: