Ubuntu 9.1 Ruby SOAP4R problem? (Digest Auth with SSL)


I spent a few days trying to understand why SOAP4R did not work properly as advertised with self-signed certificate SSL and MD5-based Digest Authentication and today I found myself really dumb!

The self-signed certificate was easily overcome by using the ‘protocol.http.ssl_config.verify_mode’ set to ‘OpenSSL::SSL::VERIFY_NONE’, however I keep getting error SSLv2/v3 error when trying to connect. The xcombinator blog helped me by pointing that simply set ‘protocol.http.ssl_config.ciphers’ to ‘ALL’ could resolved the problem (because MD5 which is used for Digest Authentication in my case, was diable !MD5 by default).

Now came the last part, every time I tried the client.options[‘protocol.http.auth’] << [url, user, pass] to enable Digest Auth, I always get error ‘check_lock’ complaining could not add locked property. I already tried gem install soap4r to the latest version, the problem still remain. Searching using ‘google’ did not help. And so I did gem uninstall soap4r, BUT, I can still the problem persists. Now, this was weird, without SOAP4R gem this should flag file not found type of error not continuing to say could not add new property! So, finally I just found the root cause, the problem actually is that Ubuntu 9.1 (my testing version) already bundles and OLD version of SOAP4R and so the new SOAP4R was never used.

Removing the soap folder in /usr/lib/ruby/1.8 resolved the problem. (I should actually remove all SOAP4R folders, but have not yet done so!).

So now my very short script

require 'rubygems'
require 'httpclient'
require 'soap/wsdlDriver'

wsdl = 'files/wsdl'
url = 'https://mysoaplocation/'

factory = SOAP::WSDLDriverFactory.new(wsdl)
drv = factory.create_rpc_driver
drv.wiredump_dev = STDOUT
drv.options['protocol.http.ssl_config.verify_mode'] = OpenSSL::SSL::VERIFY_MODE
drv.options['protocol.http.ssl_config.ciphers'] = 'ALL'
drv.options['protocol.http.auth'] << [ url, 'user', 'pass']

p drv.getAlerts(1,2,'')

works as expected!


The problem persists even when download SOAP4R source and do the ruby ./install.rb which will install SOAP4R and soap in the place not being used by ruby. But the problem may possibly be from myself as well especially the installation process of ruby1.8 on Ubuntu with rubygems that can update itself. (Default Ubuntu package will not allow gem update).

For MAC OS X,  the problem is the same with Ubuntu with soap bundled with ruby itself. But by downloading SOAP4R and do ruby ./install.rb ruby will start using this new soap routine.


No Responses Yet to “Ubuntu 9.1 Ruby SOAP4R problem? (Digest Auth with SSL)”

  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: