Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated the gem to default to using /etc/ssl/certs as the CA path so

that Httparty will authenticate twilio ssl certificate
  • Loading branch information...
commit df98f89219041c0227b5869ce13484f339188e44 1 parent 676cb0f
Kyle authored
Showing with 4 additions and 2 deletions.
  1. +1 −1  lib/twilio.rb
  2. +3 −1 lib/twilio/connection.rb
View
2  lib/twilio.rb
@@ -35,4 +35,4 @@
require 'twilio/recording'
require 'twilio/toll_free_phone_number'
require 'twilio/conference'
-require 'twilio/verb'
+require 'twilio/verb'
View
4 lib/twilio/connection.rb
@@ -1,13 +1,14 @@
module Twilio
include HTTParty
TWILIO_URL = "https://api.twilio.com/2010-04-01/Accounts"
-
+ SSL_CA_PATH = "/etc/ssl/certs"
# The connect method caches your Twilio account id and authentication token
# Example:
# Twilio.connect('AC309475e5fede1b49e100272a8640f438', '3a2630a909aadbf60266234756fb15a0')
def self.connect(account_sid, auth_token)
self.base_uri "#{TWILIO_URL}/#{account_sid}"
self.basic_auth account_sid, auth_token
+ self.default_options[:ssl_ca_path] ||= SSL_CA_PATH unless self.default_options[:ssl_ca_file]
end
# DEPRECATED - use Twilio.connect
@@ -18,6 +19,7 @@ class Connection
def initialize(account_sid, auth_token)
self.class.base_uri "#{TWILIO_URL}/#{account_sid}"
self.class.basic_auth account_sid, auth_token
+ self.class.default_options[:ssl_ca_path] ||= SSL_CA_PATH unless self.class.default_options[:ssl_ca_file]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.