Permalink
Browse files

Use ssl if endpoint is HTTPS

  • Loading branch information...
1 parent ff76dea commit 833bc12fd7d5b1fb89ed770a281c4c87843eb9e2 @sferik committed Mar 22, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/twitter/client.rb
View
@@ -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={})

0 comments on commit 833bc12

Please sign in to comment.