Skip to content
Tony Arcieri edited this page Jan 27, 2014 · 19 revisions

The HTTP gem supports HTTPS via Ruby's built-in OpenSSL support.

To use client certificates, you can pass in a custom OpenSSL::SSL::SSLContext object containing the certificates you wish to use:

ctx      = OpenSSL::SSL::SSLContext.new
ctx.cert = OpenSSL::X509::Certificate.new(File.read("client.crt"))
ctx.key  = OpenSSL::PKey::RSA.new(File.read("client.key"))

HTTP.get "https://www.google.com", :ssl_context => ctx
Clone this wiki locally