Simple HTTPS usage


I have to connect via HTTPS to a SOAP service.
I have a crt file from the SOAP service server so I can execute the
HTTPS requests.

Based on the the SOAP service docs I need to import that key (.crt file)
using keytool command on my machine (instructions originally for

But, I haven’t yet used HTTPS from Rails.

Could someone share some hints? What would be the simplest approach so I
can start testing with the service? I’ll enable https on webrick

So far I have some doubts:

  • Do I need to generate my own keys or just use the one I got
  • Where do I need to place the cert
  • I’ve seen somewhere that a file crypto.yml is needed to access the
  • How do I finally use them in my app

I’ve seen many tutorials but none simplified to get the very basic thing
Any pointers appreciated. I’ll continue looking at tutorials…



Here’s an update in case it can help someone else later.

So I needed to make SOAP request over HTTPS. I just had a crt file from
the SOAP server.

Besides soap4r plugin I required the next as well

require “soap/wsdlDriver”
require ‘http-access2’

My SOAP request needed also basic auth as well, and I only managed to
include those headers using this:

class HTTP::Message::Headers
alias :set_header :set_header unless

def set_header
    set('Authorization','Basic czsddddddddsdsdsdsdsyMzQ=')


I placed the cert I got into /certs folder

I created a file called “property” into /lib/soap and added
the cert info so soap4r plugin gets it:

client.protocol.http.ssl_config.ca_file =

To make the SOAP request I did the next:

wsdl = ‘
factory =
factory.add_method(‘getServices’, ‘’)

factory.wiredump_dev = STDERR <— so useful to see the SOAP messages

result = factory.getServices()