Suddenly auth request is failing

Suddenly my curl auth request to Twitch is failing. I haven’t changed anything, so I don’t know why?

PHP code:

$ch = curl_init('https://id.twitch.tv/oauth2/validate');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization: OAuth ' . $keys->access_token
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true); // Required for HTTP error codes to be reported via our call to curl_error($ch)
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); //wait 5 seconds else we have a problem

$r = curl_exec($ch);
$i = curl_getinfo($ch);
if(curl_errno($ch)){ $error_msg = curl_error($ch); }
curl_close($ch);

if(isset($error_msg)){ echo "CURL ERROR<br><br>".$error_msg; die; }

I added the error and timeout handling today to try and figure it out. Error just returns with “Operation timed out after 0 milliseconds with 0 out of 0 bytes received”. I assume Twitch changed something and my request method is missing something?

This suggests that your server can no longer reach Twitch.

This is unlikely to be a Twitch problem.
But something between your server and the Twitch Server.

This could be your servers firewall,
Your servers box provider.
Or one of the servers in the route between you and Twitch.

If it was a Twitch error you would get a HTTP code.
This is a flat “failed to connect”

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.