Skip to content

Instantly share code, notes, and snippets.

@le0pard
Created June 21, 2012 20:17
Show Gist options
  • Select an option

  • Save le0pard/2968280 to your computer and use it in GitHub Desktop.

Select an option

Save le0pard/2968280 to your computer and use it in GitHub Desktop.
Fix ssl problem on ruby 1.9
require 'open-uri'
require 'net/https'
module Net
class HTTP
alias_method :original_use_ssl=, :use_ssl=
def use_ssl=(flag)
self.ca_file = Rails.root.join('lib/ca-bundle.crt').to_s
self.verify_mode = OpenSSL::SSL::VERIFY_PEER
self.original_use_ssl = flag
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment