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
Installation
-
Add this line to your application's Gemfile:
gem 'certified-net-http-requests'
-
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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request