pusher / pusher-http-php

PHP library for interacting with the Pusher Channels HTTP API
https://pusher.com/docs/server_api_guide
1.42k stars 309 forks source link

Pusher cURL SSL Error #299

Closed fahmiegerton closed 3 years ago

fahmiegerton commented 3 years ago

I've updated the packages and now I encountered this error Error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api-ap1.pusher.com/apps/1125984/events?auth_key=xxxx&auth_timestamp=1616477477&auth_version=1.0&body_md5=xxxxxxxx&auth_signature=xxxxxx

How to fix that? Thanks

elverkilde commented 3 years ago

This is because your servers CA certificate store is not up to date. Here's a relevant SO answer: https://stackoverflow.com/a/31830614

I've copied it in here for your convenience:

1. Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
2. Add the following line to php.ini: (if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html).

curl.cainfo="/path/to/downloaded/cacert.pem"

Make sure you enclose the path within double quotation marks!!!

You are experiencing this because this library now defaults to using TLS. You can disable this behaviour by setting 'useTLS' => false in the options, as described in the README:

https://github.com/pusher/pusher-http-php#pusher-channels-constructor

fahmiegerton commented 3 years ago

This is because your servers CA certificate store is not up to date. Here's a relevant SO answer: https://stackoverflow.com/a/31830614

I've copied it in here for your convenience:

1. Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
2. Add the following line to php.ini: (if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html).

curl.cainfo="/path/to/downloaded/cacert.pem"

Make sure you enclose the path within double quotation marks!!!

You are experiencing this because this library now defaults to using TLS. You can disable this behaviour by setting 'useTLS' => false in the options, as described in the README:

https://github.com/pusher/pusher-http-php#pusher-channels-constructor

Thank you! I was use self signed ssl that expire in one year (I've created that a month ago) idk why it won't work with pusher. Thank you again sir!