PHP 5.6 and Twilio SDK

I tried to setup a new plugin using the Twilio API using this tutorial (https://www.twilio.com/docs/libraries/php) and I was getting a strange error regarding SSL certificates and using cURL. If you setup the example exactly, you’ll see the error.

However, if I switch PHP to version 7+, the error goes away. Not sure if that’s something you can fix or not, but thought I would make a note of it.

Fatal error: Uncaught exception 'Twilio\Exceptions\EnvironmentException' with message 'SSL certificate problem: self signed certificate in certificate chain' 

That’s the error I was getting. All of the googling I did turned up things about Windows, but I’m running on a Mac. Also, when I ran the same code using the built in PHP web server (php -S) everything worked fine with no errors.

Feel free to close this if the scope is wrong for the app. I figured you might want to know just in case!

¯_(ツ)_/¯

Hi Daron,

Interesting! It looks like it’s because the Local containers are missing a root CA cert.

You may be able to resolve it by doing the following (other than switching to PHP 7+):

  1. Right-click on the site in Local’s sidebar and go to “Open Site SSH”
  2. Run apt-get update && apt-get install ca-certificates
1 Like

How to use on windows?

Hi Clay, what’s the procedure for a Windows machine?

@clay and the local team, unfortunately on Window 10 we cannot integrate Google Client because of this similar issue:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

If you want to debug just install the WP Mail SMTP plugin and try to setup Mailer for Google. It will surely log you this error. Else try this bit of code it will definitely help you to debug which is decribed here https://github.com/googleapis/google-api-php-client#authentication-with-oauth:

			$client = new \Google_Client(
				array(
					'client_id'     => 'client_id_here',
					'client_secret' => 'client_secret_here',
					'redirect_uris' => array(
						'https://yourdomain.com',
					),
				)
			);

I hope this SSL certificate related issue for cURL error gets vanished soon. Additionally, I have a doubt why Heads-up! Your site is using HTTPS but Local SSL certificates isn’t trusted. notice pops up every time although I have trusted it few days ago!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.