I'm using the following code to send an apns notification for iOS. It was working fine before but out of no where I started getting this response from cURL "security library failure." with code 0.
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($sample_alert));
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSLCERT, $certificate);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $pem_secret);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
This issue only seems to be happening in my development environment, no matter what data is passed in.
$url = "https://api.development.push.apple.com/3/device/$device_token";
$sample_alert =
{"aps":{"alert":"sample notif message","badge":"badge","sound":"default"}
$headers =
["apns-topic: apns.topic"]