Created
January 23, 2013 19:40
-
-
Save ttringas/4612060 to your computer and use it in GitHub Desktop.
Fix for Shopify Faraday SSL error: https://gist.github.com/4208432
This file contains 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
# wget http://curl.haxx.se/ca/cacert.pem into lib first | |
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