Search code examples
laravelsslcurlchatpusher

"message": "cURL error 60: SSL: no alternative certificate subject name matches target host name 'api-.pusher.com'


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.


Solution

  • 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