Permalink
Browse files

Avoid a useless SSL warning.

  • Loading branch information...
1 parent 9f2542f commit 0d900f455dea23a99b5522f400d796ceabebb09b Zack Hobson committed Jul 21, 2009
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/hcl.rb
View
@@ -12,6 +12,18 @@
require 'hcl/task'
require 'hcl/day_entry'
+# Workaround for annoying SSL warning:
+# >> warning: peer certificate won't be verified in this SSL session
+# http://www.5dollarwhitebox.org/drupal/node/64
+class Net::HTTP
+ alias_method :old_initialize, :initialize
+ def initialize(*args)
+ old_initialize(*args)
+ @ssl_context = OpenSSL::SSL::SSLContext.new
+ @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ end
+end
+
class HCl
VERSION = "0.1.0"
SETTINGS_FILE = "#{ENV['HOME']}/.hcl_settings"

0 comments on commit 0d900f4

Please sign in to comment.