HTTP library for Ruby with HTTPS, SSL Client Certificate and Keep-Alive support?

Hi All,

I’m trying to write an HTTPS client in Ruby. It will connect to the
server using HTTPS, passing an authentication token (obtained through a
separate login process) and an SSL client certificate.

I’m doing the following with rest-client:

client =,
:ssl_client_cert =>’./certificate/client-2048.pem’)),
:ssl_client_key =>’./certificate/client-2048.key’), ‘’),
:verify_ssl => OpenSSL::SSL::VERIFY_NONE)

headers = {
‘X-Application’ => APP_KEY,
‘X-Authentication’ => @session_token,
‘content-type’ => ‘application/json’,
‘Accept’ => ‘application/json’

response =, headers)

This works, but what I’d like to do is use keep-alive to avoid having to
go through the whole process of bringing up the connection each time I
want to make a request. The delay involved makes the monitoring
application I’m writing much less useful.

However, what I can’t seem to find is a Ruby library that offers the

  • HTTPS support
  • SSL Client Certificate support
  • Keep-Alive

There’s a pull request languishing for rest-client that should provide
it. httparty has persistent_httparty but if it supports SSL Client
Certificates, there’s no documentation for it.

I could fork rest-client, merge the pull-request which has by now
bit-rotted, and use that. But surely I’m missing something here … is
there an existing library that offers what I’m looking for? Or some
documentation for httparty which explains SSL Client Certificate use
with that library?

Any assistance would be greatly appreciated.

Duncan B.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs