Created
June 21, 2012 20:17
-
-
Save le0pard/2968280 to your computer and use it in GitHub Desktop.
Fix ssl problem on ruby 1.9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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