twitch-hls-client icon indicating copy to clipboard operation
twitch-hls-client copied to clipboard

Error: invalid peer certificate: UnknownIssuer

Open brian6932 opened this issue 1 year ago • 3 comments

I don't think this is an issue of the client really, I believe Twitch may have messed up some certs. Using the debug flag shows the same stack and logs, not having such an issue with streamlink, nor just viewing the hls playlist raw in a browser or ffmpeg.

Stack from ae609e9753d2dc998fa7c9abe8d8e72595b84725 - 5cad7de32e0881c54ca243dc833ca37fd7496d27
❯ twitch-hls-client <channel> best
Fetching playlist for channel <channel>
Error: invalid peer certificate: UnknownIssuer

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: BaseThreadInitThunk
  10: RtlUserThreadStart
Stack from 99f489fb179f714601f3792af84d4f88827c4f0e and before
❯ twitch-hls-client <channel> best
Fetching playlist for channel <channel>
[ERROR] http: [60] SSL peer certificate or SSH remote key was not OK (rustls_connection_process_new_packets: invalid peer certificate: UnknownIssuer)
[ERROR] http: [60] SSL peer certificate or SSH remote key was not OK (rustls_connection_process_new_packets: invalid peer certificate: UnknownIssuer)
[ERROR] http: [60] SSL peer certificate or SSH remote key was not OK (rustls_connection_process_new_packets: invalid peer certificate: UnknownIssuer)
Error: [60] SSL peer certificate or SSH remote key was not OK (rustls_connection_process_new_packets: invalid peer certificate: UnknownIssuer)

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
config
player=mpv
player-args=- --force-window=yes
quiet=true
client-id=ue6666qo983tsx6so1t0vnawi233wa
auth-token=<token generated from the same cid>

brian6932 avatar Oct 05 '24 09:10 brian6932

Could be a random rustls issue. Did you try 1.0.5? It was the last time this was built against native tls and we just need to test gql/usher.

Can also grab the hls playlist url from elsewhere and inject it with --force-playlist-url (from the latest commit because I broke it in the last release) to bypass gql/usher:

streamlink twitch.tv/channel best --player-passthrough hls --verbose-player -p twitch-hls-client -a 'channel best -p mpv --force-playlist-url'

2bc4 avatar Oct 05 '24 14:10 2bc4

Did you try 1.0.5?

Just did, it works. And what's really weird, is that after I installed 1.0.5, then went back to a635c0b1e74e57491d006820b5baaa455e3af17a or anything between, the issue disappeared, it occurred literally right before installing and running 1.0.5, so I'm doubtful of Twitch changing something in the few seconds it took to build.

Can also grab the hls playlist url from elsewhere and inject it with --force-playlist-url (from the latest commit because I broke it in the last release) to bypass gql/usher:

streamlink twitch.tv/channel best --player-passthrough hls --verbose-player -p twitch-hls-client -a 'channel best -p mpv --force-playlist-url'

Works, although I probably should've tried this first, before the issue went away.

brian6932 avatar Oct 05 '24 16:10 brian6932

Strange, I really don't know what could've caused that then. Well I guess I'll leave this open for a week or so and if it's still OK I'll close it.

2bc4 avatar Oct 05 '24 18:10 2bc4