PHP cURL connection to api.yani.tv times out

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

Port 443 isn’t the problem. Our knowledge base says outbound connections are allowed on ports 80, 443 and 587, and blocked ports time out instead of being refused. Your request goes to 443, so the port isn’t what’s blocking it. The article also lists the services we block entirely, and api.yani.tv isn’t on that list.

The article is here:

The “after 4001 milliseconds” in your error looks like a 4-second connect timeout set in your own code, probably CURLOPT_CONNECTTIMEOUT or CURLOPT_TIMEOUT. The 502 and the X-Upstream-* headers look like they come from your script, not from our platform. So the request is probably just taking longer than 4 seconds to connect from here.

Can you raise the connect timeout to something like 15–20 seconds and tell me whether the request then succeeds? Please also post the raw curl_errno() and curl_error() output, not your script’s wrapped message. That would show whether it’s a plain timeout or a DNS or connection error.

To check whether the problem is specific to that API, you could also run a small PHP file containing <?php echo file_get_contents('https://ifconfig.me');. If that works, outbound HTTPS from your site is fine.