0

We are implementing a custom chat in a web application using Laravel and pusher. The basic functionalities like sending and receiving messages with file-sharing were working perfectly fine for few days but all of a sudden we encountered an error as follows:

"message": "cURL error 60: SSL: no alternative certificate subject name matches target host name 'api-.pusher.com' (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api-.pusher.com/apps//events?auth_key=&auth_timestamp=1622911129&auth_version=1.0&body_md5=994999b61168dbbbb9172e79341131b8&auth_signature=51992f8acbe3f6943163bb358399f30b7d8020d30a5d121e1650953480642397", "exception": "GuzzleHttp\Exception\RequestException", "file": "/home/techfin/public_html/testtest.com/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php", "line": 211

It works perfectly fine on the local machine but causes problems on the server.

Peppermintology
  • 9,343
  • 3
  • 27
  • 51
Ronak
  • 31
  • 2
  • 7

2 Answers2

1

I think you should install the CURL extension as below (on Linux):

sudo apt-get install php-curl

This will install a dependency package, which depends on the default PHP version. After that restart apache

sudo service apache2 restart

on windows: read this article

Note: Also, your api URL is wrong! instead of api-.com use api-id.pusher.com

reza khademi
  • 430
  • 4
  • 11
  • I am not sure about this answer as I have already installed the CURL with version 7.81 but still getting the same error. – Shashank Shah Jul 25 '23 at 05:33
0

You're missing the cluster ID from the curl. Normally you'd have an API URL like https://api-mt1.pusher.com. You can find the cluster for your app in the Pusher dashboard.

Giles Wells
  • 128
  • 5