OpenSSL::SSL::SSLError with SOAP4r and the Rubyforge gem
If you’ve installed the Rubyforge gem, which is a dependency of just about every gem in the wild through Hoe, then you might have see the OpenSSL::SSL::SSLError
when trying to connect to a server over SSL. This is caused by http_access2 because it refuses to connect with SSL without verifying the certificates.
The problem is a little bit tricky because SOAP4r abstracts you away from http_access2 and that makes it hard to set the proper configuration on the HTTP client. Fortunately SOAP4r has a way to configure it’s subsystem.
Let’s assume that you’ve defined a SOAP::RPC::Driver somewhere.
There are two ways of making the error go away, the first is to tell http_access2 to stop verifying certificates and just get on with the connection.
This is not recommended because one of the ideas behind SSL is that you can always verify that you’re talking to the correct server. If you want to keep this feature you will have to tell http_access2 which certificates to use.
You can find more advanced configuration examples in the SOAP4r source in sample/soap/ssl
.