twilio/twilio-php — pull request #89 by kevinburke (2012-09-12 07:15:04+00:00)
Title: Verify SSL with a standard CA cert whitelist

Uses the cacert.pem file generated by Mozilla, and curated here:
http://curl.haxx.se/docs/caextract.html

Tested extensively on a dev box.

Test plan (if you are curious):

- Write any script that hits https://api.twilio.com
- Test that curl https://api.twilio.com on the command line succeeds
- Move the certificate folder away from its usual location (on Ubuntu, `mv /etc/ssl/certs /etc/ssl/blah`). I tested this on a Mac by creating a lucid32 Vagrant box with no NAT dns resolving.
- Test that `curl https://api.twilio.com` on the command line fails with an SSL validation error when the folder is out of place.
- Replace the contents of `cacert.pem` with only the Thawte certificate (eg one not used by Twilio for validation). Test that your rest API script fails
- Move the certs folder back into place. Verify that the request succeeds
- Move the certs folder away from its usual location, restore the contents of `cacert.pem`. Verify the request succeeds