Skip to content

Instantly share code, notes, and snippets.

@eric
Forked from holman/SAFE-RUBY.rb
Created February 16, 2011 06:24
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 eric/828957 to your computer and use it in GitHub Desktop.
Save eric/828957 to your computer and use it in GitHub Desktop.
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