From 113b14bc05a9f8e513245fda057e7f16f8965357 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Thu, 30 May 2013 08:13:15 -0400 Subject: [PATCH] Remove default SSL configuration options and override Closes #399. --- lib/twitter/client.rb | 7 ++----- lib/twitter/default.rb | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/twitter/client.rb b/lib/twitter/client.rb index 8ffe3a7b5..bf37e333c 100644 --- a/lib/twitter/client.rb +++ b/lib/twitter/client.rb @@ -79,6 +79,7 @@ def put(path, params={}) end private + # Returns a proc that can be used to setup the Faraday::Request headers # # @param method [Symbol] @@ -116,11 +117,7 @@ def request(method, path, params={}, signature_params=params) # # @return [Faraday::Connection] def connection - @connection ||= begin - connection_options = {:builder => @middleware} - connection_options[:ssl] = {:verify => true} if @endpoint[0..4] == 'https' - Faraday.new(@endpoint, @connection_options.merge(connection_options)) - end + @connection ||= Faraday.new(@endpoint, @connection_options.merge(:builder => @middleware)) end # Generates authentication header for a bearer token request diff --git a/lib/twitter/default.rb b/lib/twitter/default.rb index 3f05bce1d..b191d3dbb 100644 --- a/lib/twitter/default.rb +++ b/lib/twitter/default.rb @@ -20,9 +20,6 @@ module Default :open_timeout => 5, :timeout => 10, }, - :ssl => { - :verify => false - }, } unless defined? Twitter::Default::CONNECTION_OPTIONS IDENTITY_MAP = false unless defined? Twitter::Default::IDENTITY_MAP MIDDLEWARE = Faraday::Builder.new do |builder|