Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 43605a8b391d52876403ecf44356e2475ed29eb8 @stevegraham committed Nov 26, 2011
Showing with 3,404 additions and 0 deletions.
  1. +16 −0 certified.gemspec
  2. +12 −0 certified.rb
  3. +3,376 −0 certs/ca-bundle.crt
16 certified.gemspec
@@ -0,0 +1,16 @@
+Gem::Specification.new do |s|
+ s.platform = Gem::Platform::RUBY
+ s.name = 'certified'
+ s.version = '0.1.0'
+ s.summary = 'Ensure net/http uses peer verification'
+ s.description = "Provides a certificate bundle in case cannot find it's own to verify certificates. Ensures verify mode is set to OpenSSL::SSL::VERIFY_PEER"
+
+ s.required_ruby_version = '>= 1.8.7'
+
+ s.author = 'Stevie Graham'
+ s.email = 'sjtgraham@mac.com'
+ s.homepage = 'http://github.com/stevegraham/certified'
+
+ s.files = Dir['README.md', 'certified.rb', 'certs/ca-bundle.crt']
+ s.require_path = '.'
+end
12 certified.rb
@@ -0,0 +1,12 @@
+require 'net/https'
+
+Net::HTTP.class_eval do
+ alias _use_ssl= use_ssl=
+
+ def use_ssl= boolean
+ self.ca_file = './certs/ca-bundle.crt'
+ self.verify_mode = OpenSSL::SSL::VERIFY_PEER
+ self._use_ssl = boolean
+ end
+end
+
3,376 certs/ca-bundle.crt
3,376 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 43605a8

Please sign in to comment.