Skip to content

Instantly share code, notes, and snippets.

Created August 29, 2013 14:24
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#!/usr/bin/env ruby -w
require 'net/http'
require 'net/https'
require 'openssl'
require 'uri'
DIR = File.dirname(__FILE__)
uri = URI.parse("")
https =, uri.port)
https.cert ="#{DIR}/28143-VALFAC-MPIclient.crt"))
https.key ="#{DIR}/28143-VALFAC-MPIclient.key"))
https.ca_file = "#{DIR}/VALFAC-trustedroot.pem"
https.use_ssl = true
https.read_timeout = 30
#raise 'certificate can not be verified' unless https.cert.verify https.key
req =
req.body ="#{DIR}/vereq.xml")
req.content_type = 'application/x-www-form-urlencoded'
res = https.request(req)
p res.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment