Forum: Ruby on Rails How to stop SOAP4R/OpenSSL requiring cert?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
07423d43a61690510a695b6c55c74afb?d=identicon&s=25 Michael Mcgrath (fatherted)
on 2008-12-10 17:44
Hi
I want to consume some web services that are only available over HTTPS.

My method looks like this:
  def lookup_id
    myid=params[:id]
    driver =
SOAP::WSDLDriverFactory.new("https://server.com/xxx.wsdl").create_rpc_driver
    @p=driver.verifyId(AUTH_TOKEN, PIN, myid)
  end

Although this works fine on my local box (with a warning), when deployed
to the staging server I get:
 OpenSSL::SSL::SSLError (certificate verify failed):

Can anyone assist me in telling SOAP4R and/or OpenSSL to simply treat
this is a warning rather than an error?

Thanks in advance,
Michael.
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2008-12-11 17:36
(Received via mailing list)
On Dec 10, 2008, at 11:44 AM, Michael Mcgrath wrote:

>
> Hi
> I want to consume some web services that are only available over
> HTTPS.
>
> My method looks like this:
>  def lookup_id
>    myid=params[:id]
>    driver =
> SOAP::WSDLDriverFactory.new("https://server.com/xxx.wsdl"

Try this:

SOAP::WSDLDriverFactory.new("https://server.com/xxx.wsdl",
   { 'ssl_config' => { 'verify_mode' => OpenSSL::SSL::VERIFY_NONE }})

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
07423d43a61690510a695b6c55c74afb?d=identicon&s=25 Michael Mcgrath (fatherted)
on 2008-12-11 17:40
Rob,
thanks for your response.

> SOAP::WSDLDriverFactory.new("https://server.com/xxx.wsdl",
>    { 'ssl_config' => { 'verify_mode' => OpenSSL::SSL::VERIFY_NONE }})
This gives "wrong number of arguments (2 for 1)"

Michael
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2008-12-11 20:50
(Received via mailing list)
On Dec 11, 2008, at 11:40 AM, Michael Mcgrath wrote:
> Rob,
> thanks for your response.
>
>> SOAP::WSDLDriverFactory.new("https://server.com/xxx.wsdl",
>>   { 'ssl_config' => { 'verify_mode' => OpenSSL::SSL::VERIFY_NONE }})
> This gives "wrong number of arguments (2 for 1)"
>
> Michael

This might have to go closer to the place where the connection is
made.  I'd just be diving into the soap4r code anyway, so splash on in
yourself.

There is also a place (somewhere) that lets you put a similar line
into a config file for your SSL connections.  I think rdoc for the
SOAP4R library has an example.

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
B0f6756b62559d43213636dde11bb785?d=identicon&s=25 BenH (Guest)
on 2009-03-26 22:15
(Received via mailing list)
Try this out:

wsdl = "https://some.site/some_web_service.asmx?WSDL"
drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
drv.options['protocol.http.ssl_config.verify_mode'] =
OpenSSL::SSL::VERIFY_NONE

Ben

On Dec 11 2008, 9:40 am, Michael Mcgrath <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.