How to Make Httparty Ignore Ssl

How can you verify ssl certificates using the httparty ruby gem?

Julian ending up solving it like this: https://github.com/coinbase/coinbase-ruby/commit/7bd9b6576bd267001202d21082a4c151fc87e4c4

He added some additional notes:

You can get the actual certificate chain from the authority in most cases: https://www.digicert.com/digicert-root-certificates.htm

Or something like this would also work:

openssl s_client -showcerts -connect yourwebsite.com:443

How to bypass SSL certificate verification in open-uri?

Warning, do not do this in production, you are disabling SSL completely this way.

If you really don't want the additional security of using certificate verification, and can upgrade to Ruby 1.9.3p327+, you can pass the ssl_verify_mode option to the open method. Here for example is how I'm doing it:

request_uri=URI.parse('myuri?that_has=params&encoded=in_it&optionally=1')

# The params incidentally are available as a String, via request_uri.query
output = open(request_uri, {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE})
obj = JSON.parse output.readlines.join("")

HTTPS and HTTParty - Timeout and EOF

As read at
http://railstips.org/blog/archives/2008/07/29/it-s-an-httparty-and-everyone-is-invited/

"HTTPS is in. If the uri has port 443 it automatically turns https on."



Related Topics



Leave a reply



Submit