• Home
  • Log
  • Projects
  • Gallery
  • About
  • Contact

Quieting Ruby’s SOAP warnings

August 18th, 2006

At work lately I’ve been developing a SOAP interface from a third party vendor we are currently using. In the process I’ve decided to use Ruby to do this. I need to learn more Ruby and I thought it would be easier to use than the last time I worked with Python and SOAP.

Thus far everything is working great, the only annoyance I have is that I keep getting this as output from my connection:

peer certificate won’t be verified in this SSL session
.
I know this is because I’m connecting to an HTTPS URL but there must be someway to quiet this error message down, because it’s really becoming irritating.

Some quick Googling turnes up this command:

https = Net::HTTP.new(URL, 443)
https.use_ssl = true

https.verify_mode = OpenSSL::SSL::VERIFY_NONE

I included the first two lines to give context on how this was used and how it doesn’t precisely carry over to the SOAP module becuase it isn’t an option inherited by the SOAP object.

However I figured that the SOAP module must be creating an HTTP connection in there somewhere. So I decided to quickly jump into the source code and see what I can find. I located a single line in the source code for creating the HTTP object similar to how it’s used above.

/soap/netHttpClient.rb: http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port)

After quickly firing up my vi and adding the line:

http.verify_mode = OpenSSL::SSL::VERIFY_NONE

Even though it isn’t specifically creating a HTTPS connection here it ended up silencing the warnings. So I’ll just leave my code this way and enjoy it being much, much quieter.

Posted in Programming |


Leave a Reply

  • Pages

    • About
  • Archives

    • October 2008
    • November 2007
    • November 2006
    • October 2006
    • August 2006
    • July 2006
    • June 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • October 2005
    • May 2005
  • Categories

    • Uncategorized (1)
    • Music (1)
    • Graphics (3)
    • Programming (8)
    • Misc (15)
    • Travel (3)
    • Linux (3)
 Use OpenOffice.org

Powered by WordPress Entries (RSS)
and Comments (RSS). 14 queries. 0.248 seconds.