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
What Does "+=" (Plus Equals) Mean
How to Test 'Rand()' with Rspec
How to Format Irb Command Prompt
Ruby: Intersection Between Two Ranges
How to Identify Aliased Methods in Ruby
Handling a JavaScript Popup Occurring on a Keyup Event
Nokogiri - Error: Failed to Build Gem Native Extension
How to Run Only Specific Tests in Rspec
Ruby (And Rails) Nested Module Syntax
How to Change Column Type in Heroku
Calling Sinatra from Within Sinatra
Heroku App Crash H10 - Bash: Bin/Rails: No Such File or Directory
Getting Uninitialized Constant Error When Trying to Run Tests
What Does &: Mean in Ruby, Is It a Block Mixed with a Symbol
Use Rvm to Force Specific Ruby in Xcode Run Script Build Phase
Ruby Design Pattern: How to Make an Extensible Factory Class