Skip to content

Commit

Permalink
Use ssl if endpoint is HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Mar 22, 2013
1 parent ff76dea commit 833bc12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/twitter/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ def request(method, path, params={}, signature_params=params)
#
# @return [Faraday::Connection]
def connection
@connection ||= Faraday.new(@endpoint, @connection_options.merge(:builder => @middleware))
@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
end

def auth_header(method, path, params={})
Expand Down

0 comments on commit 833bc12

Please sign in to comment.