Permalink
Browse files

added support for ssl (without cert verification)

  • Loading branch information...
1 parent a07b536 commit 366e84eff4d77bfd6129024dc3a9fbab7580e90b @chriskite chriskite committed with Oct 18, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/anemone/http.rb
View
8 lib/anemone/http.rb
@@ -1,4 +1,4 @@
-require 'net/http'
+require 'net/https'
module Anemone
class HTTP
@@ -62,6 +62,12 @@ def close_connections!
def get_connection(url)
connection = Net::HTTP.new(url.host, url.port)
+
+ if url.scheme == 'https'
+ connection.use_ssl = true
+ connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ end
+
yield connection
end
end

0 comments on commit 366e84e

Please sign in to comment.