I'm using Minishlink/WebPush package to send a push notification from my server to my client but I'm getting this error:
array(3) {
["success"]=>
bool(false)
["endpoint"]=>
string(188) "***"
["message"]=>
string(179) "cURL error 77: error setting certificate verify locations:
CAfile: C:\xampp\apache\bin\curl-ca-bundle.crt
CApath: none (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
}
This is my code:
require __DIR__ . '../../../vendor/autoload.php';
use Minishlink\WebPush\WebPush;
$vapidAuth = array(
'VAPID' => array(
'subject' => 'https://github.com/Minishlink/web-push-php-example/',
'publicKey' => '***',
'privateKey' => '***'
)
);
$webPush = new WebPush($vapidAuth);
$res = $webPush->sendNotification(
$subscription['ius_endpoint'],
'hello world!',
$subscription['ius_p256dh'],
$subscription['ius_auth'],
true
);
My sw code on my client is working because I've tried to manually push a notification using javascript to my registered sw.