Reputation: 123
I been trying to seen SMS messages from Twilio but get the error message.
I have added a path to a new curl.cainfo
in the php.info
curl.cainfo = c:\wamp\certs\cacert.pem
yet I still was getting an error.
ERROR MESSAGE WAS:
Fatal error: Uncaught exception 'Services_Twilio_TinyHttpException' with message 'SSL certificate problem: self signed certificate in certificate chain' in C:MYPATH\twilio-php-master\twilio-php-master\Services\Twilio\TinyHttp.php on line 119
This is the PHP code:
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require ('C:/wamp/www/Services/Twilio.php'); // Loads the library
$sid = "Axxxxxxxxxxxxxxxxxxxxxxx9";
$token = "8xxxxxxxxxxxxxxxxxxxxxxx2";
$http = new Services_Twilio_TinyHttp(
'https://api.twilio.com',
array('curlopts' => array(
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
)));
$client = new Services_Twilio($sid, $token, "2010-04-01", $http);
$sms = $client->account->sms_messages->create("+1480xxxxx", "+1520xxxxx", "HELP please?! I love you <3", array());
echo $sms->sid;
?>
Im using Windows 8, and the the curl version:cURL Information 7.36.0
is enabled
should I update the curl stated in https://github.com/twilio/twilio-php/blob/master/docs/faq.rst
What am I doing Wrong?
Upvotes: 0
Views: 3696
Reputation: 1
Make same changes in php.ini inside apache bin folder. "curl.cainfo = c:\wamp\certs\cacert.pem" Restart the service.
Upvotes: 0
Reputation: 296
Twilio Customer Support here!
Did you update cURL as mentioned earlier?
https://github.com/twilio/twilio-php/blob/master/docs/faq.rst#ssl-validation-exceptions
It should resolve the issue, if not ping [email protected] an email and we can look into it.
Upvotes: 2