Reading from calendars.icloud.com fails recently...why?

Viewed 472

We are running WordPress, where a very old script reads the URL of an iCal calendar:

$webcal = 'http://pXX-calendars.icloud.com/published/2/verylongstring';

if(!$data = file_get_contents($webcal, false, stream_context_create(array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false))))) {
                echo "<!-- could not read calendar -->\n\r";
            }

Recently this fails, and I don't know why.

A year ago I have changed the file_get_contents() from

file_get_contents($webcal)

to

file_get_contents($webcal, false, stream_context_create(array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false)))))

because reading failed, and after the change it worked again.

We are getting an 502 Bad Gateway Error when we enter the $webcal URL into the browser.

Maybe Apple has changed something (like authentication or else)?

What happened and how can we solve this?

1 Answers

It is working now, with a different URL that I've tried:

$webcal = 'http://pXX-caldav.icloud.com/published/2/verylongstring'

instead of

$webcal = 'http://pXX-calendars.icloud.com/published/2/verylongstring';

Sadly, I have no idea why this works now and didn't work with the old URL. Maybe Apple or the customer using this iCal changed something. The pXX-calendars version might have become deprecated, and nobody knew about it...?

Related