So I'm just trying out twilio but I seem to be having some trouble with cURL errors; specifically:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.twilio.com/2010-04-01/Accounts/XXXXXXXXXXXXXXXXXXXXXXXX/Messages.json
Here is some important notes:
- This is in PHP
- Using Laravel framework
Basically I'm using direct to a controller and using a response.
SmsController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
class SmsController extends Controller
{
public function send()
{
$id = env('TWILIO_APP_ID');
$token = env('TWILIO_APP_TOKEN');
$from = env('TWILIO_FROM_NUMBER');
$to = env('TWILIO_TONG_NUMBER');
$url = 'https://api.twilio.com/2010-04-01/Accounts/'.$id.'/Messages.json';
$client = new Client();
$response = $client->request('POST', $url, [
'auth' => [$id, $token],
'form_params' => [
'From' => $from,
'To' => $to,
'Body' => 'hello from the other side! - ryan :)'
]
]);
return response()->json(['test'=> 'worked']);
}
Before anyone asks; yes I've spent a day reading other peoples problems related to cURL; and I was unable to find any solutions.
I tried adding certs to my ...\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt
I didnt work.
I tried re-installing Git.
It also didnt work.
When I run php -m I cal see curl in PHP Modules. But I'm not sure if it up to date how to check or if its not the problem.
Any help would be greatly appreciated :)