3

I'm connecting to a biztalk SOAP API, and I've been given a public cert from the server to use to connect using ssl server authentication.

I'm using: Ruby 1.9.2, Curb (0.7.15), Savon (0.9.1) HTTPi (0.9.2)

I can't seem to get it to work properly, but it works from the command line with CURL:

curl --cacert /path/to/cert https://raadeeraa

but I can't work out the combination of how to get it to work with Savon, HTTPi and Curb.

This goes through:

http.auth.ssl.ca_cert_file = '/path/to/cert'
http.auth.ssl.verify_mode = :peer

But this also goes through, so I don't think it's working properly:

http.auth.ssl.ca_cert_file = '/complete/load/of/nonsnse'
http.auth.ssl.verify_mode = :peer

This fails with a ssl cert error:

http.auth.ssl.ca_cert_file = '/path/to/cert'
http.auth.ssl.verify_mode = :none

`cert=': undefined method `rindex' for nil:NilClass (NoMethodError)

So I specify a cert as well:

http.auth.ssl.ca_cert_file = '/path/to/cert'
http.auth.ssl.cert_file = '/path/to/cert'
http.auth.ssl.verify_mode = :none

rails3.0.4/gems/httpi-0.9.2/lib/httpi/adapter/curb.rb:29:in `http_post': Problem with the local SSL certificate (Curl::Err::SSLCertificateError)

Please don't think I'm posting without reading, I've read all these pages and can't find a solution. Well, you'll have to take my word for it, I can only put up two hyperlinks :-)

http://rubydoc.info/gems/httpi/0.9.2/frames

https://github.com/rubiii/httpi

Any suggestions will be greatly appreciated.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Vanderkerkoff
  • 31
  • 1
  • 2
  • I'm drilling down, and I've got httpclient to work on it's own as I'd expect, here's the code
    require 'httpclient'
    
    client = HTTPClient.new
    client.ssl_config.set_trust_ca('certificate off the server')
    
    url = "https://doodaa"
    resp = client.get(url)
    puts resp.content
    puts resp.status
    If I alter that certificate, or use another one, it fails, as it should. How to represent that code in savon is the next question. I'm going to remove curb and go with httpclient from now on, at least I know that works in this instance
    – Vanderkerkoff Apr 13 '11 at 10:30
  • Here's some more details http://www.ruby-forum.com/topic/1490195#new – Vanderkerkoff Apr 13 '11 at 12:37
  • I found the problem [link](http://www.ruby-forum.com/topic/1490195#992527) – Vanderkerkoff Apr 13 '11 at 14:40

0 Answers0