Savon connecting to SoapUI SSL Mock Service

553 views Asked by At

I'm trying to do a proof of concept that Ruby can call SOAP web services using Savon through SSL. I'm a noob at this so I apologize for any errors in advance.

I followed a tutorial from the following link to have SoapUI create a mock SSL service with a keystore: http://www.soapui.org/soap-mocking/tips-and-tricks/securing-mockservices-with-ssl.html

Here is what my ruby code looks like at the moment:

client = Savon.client(
                wsdl: "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL",
                endpoint: "https://localhost:8002/mockCurrencyConvertorSoap",       
                ssl_version: :SSLv3,
                ssl_cert_key_file: "lib/private-key.key",
                ssl_cert_file: "lib/public-key.pub", 
                ssl_ca_cert_file: "lib/trust-soapui.pem",
                ssl_cert_key_password: "password",
                ssl_verify_mode: :peer,
                adapter: :httpclient,
                log_level: :debug,
                log: true,
                logger: Rails.logger,
                pretty_print_xml: true
            )

    response = client.call(:conversion_rate, 
                   message: {"FromCurrency" => "USD", "ToCurrency" => "JPY"}     )

Here is the error I am receiving:

HTTPI::SSLError (hostname does not match the server certificate)

I believe I might have fundamentally created the keys incorrectly even though it came from the same keystore.jks that SoapUI Mock Service is using. What am I missing?

NOTE: This will obviously work if I set

ssl_verify_mode: :none
but I would really like to check if my certs are correct.

I'm on Windows 7 Pro using RailsInstaller.

Ruby 1.9.3
Rails 3.2.11
Savon 2.11.1
httpclient 2.6.0.1

0

There are 0 answers