Created
April 14, 2015 18:49
-
-
Save siruguri/66926b42a0c70ef7119e to your computer and use it in GitHub Desktop.
Removing and setting constants in Ruby
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
# I am doing this because the server admin forgot to | |
# Renew their certificate! | |
prev_setting = OpenSSL::SSL.send(:remove_const, :VERIFY_PEER) | |
OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE) | |
# do my connnection thang! | |
OpenSSL::SSL.send(:remove_const, :VERIFY_PEER) | |
OpenSSL::SSL.const_set(:VERIFY_PEER, prev_setting) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment