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

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.

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

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.

Related

knative helloworld does not run microk8s due to x509 certificate issue

I have installed knative on microk8s using ubuntu (Ubuntu 20.04 LTS). I am trying basic knative example , but it's not working.
1. First I've tried with kn. (kn was not able to read configuration, so I've exported the configuration using microk8s.config > ~/kubeconfig
kn --kubeconfig ~/kubeconfig service create hello --image gcr.io/knative-samples/helloworld-go --env TARGET=Knative
Internal error occurred: failed calling webhook "webhook.serving.knative.dev": Post "https://webhook.knative-serving.svc:443/defaulting?timeout=30s": x509: certificate is not valid for any names, but wanted to match webhook.knative-serving.svc
I've tried to load using kubectl create, but getting the same error.
Any idea.
What version of Knative are you using?
It looks like your Knative webhook may be generating a certificate with an empty subject. Have you tried connecting to the webhook directly on the cluster via curl -kvv https://webhook.knative-serving.svc:443/defaulting? That should print out the certificate and ignore the validation so that you can test that the service is working.

Laravel - Mailing system doesn't work on my Web server but gives cURL error 7: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I am using Mailgun to send mail and It works well on my local server, but on my Web Server, where the site is hosted on HackFlix, It produces this error after sending
GuzzleHttp\Exception\ConnectException
cURL error 7: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I have done many research to this problem and i didn't get any correct answer that solves cURL error 7. Some people say that i should ping or nslookup smtp.mailgun.org but I don't have SSH shell access on my server. Please, what is the solution to this problem?

Laravel Dusk Testing has an error on the server Curl error thrown for http POST to /session with params

I would like to ask me to try the following instructions on Plesk Server:
php artisan dusk
The following error will occur:
1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary" :".\/vendor\/laravel\/dusk\/bin\/chromedriver-linux","args":["--disable-gpu","--headless","--no-sandbox"," --verbose","--window-size=1024,768"]}}}
Failed connect to localhost:9515; Connection refused
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:292
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126
/var/www/vhosts/fanswoo.com/fanswoo-framework/tests/DuskTestCase.php:43
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:192
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/laravel/framework/src/Illuminate/Support/helpers.php:754
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php: 193
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:93
/var/www/vhosts/fanswoo.com/fanswoo-framework/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:64
/var/www/vhosts/fanswoo.com/fanswoo-framework/tests/Browser/ExampleTest.php:22
I suspected that the Chrome Driver could not be executed, so I used the following command to detect:
./vendor/laravel/dusk/bin/chromedriver-linux
The return is as follows:
Starting ChromeDriver 2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d) on port 9515
Only local connections are allowed.
Indicates that ChromeDriver can be opened normally.
The code can also be detected on the local computer. Only when the dusk command is executed in Plesk Server will the error occur. May I ask what God should I continue to do or what to modify? Thank you!
The server specifications are as follows:
CentOS 7.5
PHP 7.1
DB SQLite3
Laravel Version 5.7
ChromeDriver Version 69
If you able to start chromedriver successfully, now try to access the below url with respective port.
http://localhost:{port}/status
For e.g., in above message, the server started on port 9515. Access the url in browser, http://localhost:9515/status
You should get above message indicating server is accessible with hostname as localhost
If your are not able access, then fix the specific issue

Docker For Mac / Lando: cannot cURL external webservice

I am testing out Lando for a new local dev setup.
Everything has gone well so far but I am running into an error that I don't get on my old Vagrant/VM environment, but do with Lando.
We have part of the site that uses Guzzle to fetch data from a web service. On Lando, I get a cURL error:
cURL error 7: Failed to connect to webservice.internalsite.com port 80: No route to host
How can I resolve this? When I try to ping that url, it says "Destination host unreachable". I am using Docker For Mac if that factors in.

Phusion Passenger Enterprise fails to connect to the licensing server behind a proxy

We're trying to upgrade to Phusion Passenger Enterprise edition from the open source version but we're running into an issue. Passenger fails to connect to the licensing server with the following error message:
[ W 2018-03-27 10:20:55.2565 35498/T6 age/Cor/CloudUsageTracker.h:439 ]: Could not contact the Phusion Passenger Enterprise licensing server (HTTP error: Failed to connect to www.phusionpassenger.com port 443: Connection timed out). To ensure proper access to the licensing server, please try these:
- Ensure that your network connection to https://www.phusionpassenger.com works.
- If you can only access https://www.phusionpassenger.com via a proxy, please set the config option 'PassengerCtl licensing_proxy PROXY_URL' (Apache) or 'passenger_ctl licensing_proxy PROXY_URL' (Nginx). 'PROXY_URL' takes the format of protocol://username:password#hostname:port, where 'protocol' is either 'http' or 'socks5'.
We need to use a proxy for all outgoing HTTP connections, so I have added the recommended config option:
passenger_ctl licensing_proxy http://OURPROXY:3128;
However the issue persist with the same error message.
Using curl to hit this URL through the proxy works as expected:
$ curl -x http://OURPROXY:3128 https://www.phusionpassenger.com
We are using nginx with Passenger on Ubuntu 14.04 LTS, Passenger Enterprise is installed from the official APT repository.
What could be causing this error? Any help would be much appreciated.
I have received an answer to this question from the Phusion Passenger support. They had accidentally misspelled the name of the relevant config option in the error message.
The correct way to set this option is:
passenger_ctl licensing_proxy_url http://OURPROXY:3128;
Related to this question, if you want Passenger to check for security updates behind a proxy, you will also need to set that separately:
passenger_security_update_check_proxy http://OURPROXY:3128;

Resources