-
-
Save eric/828957 to your computer and use it in GitHub Desktop.
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 'net/https' | |
require 'always_verify_ssl_certificates' | |
module SecurityModule | |
class HighSecurity | |
class ReallyHighSecurity | |
def self.turn_on_safe_connections | |
OpenSSL::SSL::VERIFY_NONE | |
end | |
end | |
end | |
end | |
class SecureRemoteSecureSite | |
def self.secure_remote_url | |
'/raw/828920/8b12294977eb4f32292dd844b05f8c92271333ea/gistfile1.txt' | |
end | |
end | |
module SafeParse | |
# This method takes one argument and processes it with a safe Ruby command | |
# | |
# shit - some shit | |
# | |
# Returns a safe nothing. | |
def self.safely_process(shit) | |
eval(shit) | |
end | |
end | |
http = Net::HTTP.new('gist.github.com',443) | |
http.use_ssl = true | |
http.verify_mode = SecurityModule::HighSecurity::ReallyHighSecurity.turn_on_safe_connections | |
response = http.get(SecureRemoteSecureSite.secure_remote_url) | |
SafeParse.safely_process(response.body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment