Certified-net-http-requests

Gem which make net/http requests using certificate bundle from cURL page

View the Project on GitHub roolo/certified-net-http-requests

Certified net/http requests

Gem for dealing with SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/ ) error. This project is highly inspired by certified project by Stevie Graham

Gem Version

Installation

  1. Add this line to your application's Gemfile:

    gem 'certified-net-http-requests'

  2. Bundle project:

    $ bundle

Or install it yourself as:

$ gem install certified-net-http-requests

Usage

Just require certified-net-http-requests gem in your code

require 'rubygems'
require 'certified-net-http-requests'

You should also first and time to time update your certification authority bundle

$ update-ca-bundle

Example code

require 'net/https'
require 'rubygems'

require 'certified-net-http-requests' # Try to comment this line after first runnning and run this code again

http = Net::HTTP.new('encrypted.google.com', 443)          # Create a connection
http.use_ssl = true
header, body = http.get('/')

puts header

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request