Skip to content

Instantly share code, notes, and snippets.

@mrjman
Last active August 29, 2015 14:04
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 mrjman/30bed4495c50e20d9e5d to your computer and use it in GitHub Desktop.
Save mrjman/30bed4495c50e20d9e5d to your computer and use it in GitHub Desktop.
require "net/http"
require "openssl"
cert_store = OpenSSL::X509::Store.new
cert_store.add_file 'certs/AddTrustExternalCARoot.crt'
cert_store.add_file 'certs/COMODORSAAddTrustCA.crt'
http = Net::HTTP.new('ume.michaeljfox.org', 8097)
#http = Net::HTTP.new('173.193.29.12', 11121)
http.use_ssl = true
# Set cert store to use default system paths
#http.cert_store = OpenSSL::X509::Store.new
#http.cert_store.set_default_paths
# use explicit cert store with certs added manually
http.cert_store = cert_store
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.get('/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment