twilio-php: SSL certificate problem: self signed certificate in certificate chain
Hello,
I am upgrading from Twilio PHP Library from v3.12.1
to v3.12.6
Right away I am getting this error
SSL certificate problem: self signed certificate in certificate chain
We are moving all dependency under composer support. Please let me know if there is any steps involved to upgrade. v3.12.1
had an certificate file I do not see it on v3.12.6
Please advice a workaround which allow us to connect via https
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 31 (4 by maintainers)
We’ve removed the pinned certificate chain from the library as it caused problems when we replaced expired certificates in the API servers. You’ll need to ensure your PHP installation has access to a recent bundle of CA certificates so it can verify the server certificates. Here’s a quick rundown: http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/
In twilio\sdk\Twilio\Http\CurlClient.php add CURLOPT_SSL_VERIFYPEER => false, after CURLOPT_TIMEOUT => $timeout,
This will solve the issue in local.
I have the same problem, but the suggested fix doesn’t seem to work.
I have an updated cacert.pem file that is referenced in the php.ini file using curl.cacert, and I have tried the following code to try to update the cacert at runtime: $_http = new Services_Twilio_TinyHttp ( “https://api.twilio.com”, array(“curlopts” => array ( CURLOPT_USERAGENT => ‘twilio-php/4.2.0’, CURLOPT_HTTPHEADER => array(‘Accept-Charset: utf-8’), CURLOPT_CAINFO => ‘/etc/php5/cacert.pem’ ) ) ); $client = new Services_Twilio($AccountSid, $AuthToken,null,$_http);
Based on everything I’ve read that should fix it, but it doesn’t. Setting: CURLOPT_SSL_VERIFYPEER => false does fix the problem. Is there something I’m missing here?