Skip to content

Instantly share code, notes, and snippets.

@mic-kul
Created March 30, 2016 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mic-kul/5867bb59cf9c9669c5e137fff5fbedeb to your computer and use it in GitHub Desktop.
Save mic-kul/5867bb59cf9c9669c5e137fff5fbedeb to your computer and use it in GitHub Desktop.
# initializers/bypass_openssl_verification.rb
require 'openssl'
# Ruby 1.9.3:
if Rails.env.development?
OpenSSL::SSL.send(:remove_const, :VERIFY_PEER)
OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE)
end
# Ruby > 2.x
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if Rails.env.development?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment