0

I was trying to lookup carrier of a phone number using Twilio PHP SDK. However, I was getting certification error. I am not sure what I am doing wrong. If anyone can give me advice, I really appreciate! Thank you.

$lookup_client = new Lookups_Services_Twilio( $this->twilio_sid, $this->twilio_token );

$number = $lookup_client->phone_numbers->get(
            '1-416-333-1111',
            array(
                'Type'          => 'carrier',
                "CountryCode"   => "US",
            )
);
echo $number->carrier;

Services_Twilio_TinyHttpException: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in twilio-php\Services\Twilio\TinyHttp.php on line 119

redpotato
  • 142
  • 1
  • 2
  • 15
  • You should check this out. http://stackoverflow.com/questions/6400300/https-and-ssl3-get-server-certificatecertificate-verify-failed-ca-is-ok – Allan Stepps Dec 03 '16 at 19:24

1 Answers1

0

I made this a while ago. I also made it where you can raw input the phone number. hope it helps!

import sys
import os
from twilio.rest.lookups import TwilioLookupsClient

try:
    client = TwilioLookupsClient()
    phone = raw_input (" Enter The Targets Phone Number: ")

    number = client.phone_numbers.get((phone), include_carrier_info=True, )
    print(number.carrier['name'])
    print(number.carrier['type'])
except:
    print ("Error While Handling Phone Number")