Browse files

Turning off ssl peel validation for ruby 1.8

  • Loading branch information...
1 parent e2fcc4a commit c979880745105a19add0dc9119b411561df372f3 @pcorliss pcorliss committed Dec 9, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/route53.rb
View
6 lib/route53.rb
@@ -34,7 +34,8 @@ def request(url,type = "GET",data = nil)
puts "Req: #{data}" if type != "GET" && @verbose
uri = URI(url)
http = Net::HTTP.new(uri.host, uri.port)
- http.use_ssl = true
+ http.use_ssl = true if uri.scheme == "https"
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE if RUBY_VERSION.start_with?("1.8")
time = get_date
hmac = HMAC::SHA256.new(@secret)
hmac.update(time)
@@ -81,7 +82,8 @@ def get_date
if @date_stale.nil? || @date_stale < Time.now - 30
uri = URI(@endpoint)
http = Net::HTTP.new(uri.host, uri.port)
- http.use_ssl = true
+ http.use_ssl = true if uri.scheme == "https"
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE if RUBY_VERSION.start_with?("1.8")
resp = nil
puts "Making Date Request" if @verbose
http.start { |http| resp = http.head('/date') }

0 comments on commit c979880

Please sign in to comment.