From d8c4be9744f0b35a999ce74db2b5f831e0ac62a3 Mon Sep 17 00:00:00 2001 From: Sarah Zelechoski Date: Tue, 2 Apr 2013 20:15:41 -0300 Subject: [PATCH] Update haste.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add HTTPS capability  --- lib/haste.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/haste.rb b/lib/haste.rb index 4fe5b67..36940d0 100644 --- a/lib/haste.rb +++ b/lib/haste.rb @@ -25,7 +25,13 @@ module Haste # Upload the and output the URL we get back def start uri = URI.parse server - http = Net::HTTP.new uri.host, uri.port + if uri.scheme =~ /^https/ + http = Net::HTTP.new uri.host, uri.port + http.use_ssl = true + http.verify_mode = OpenSSL::SSL::VERIFY_NONE + else + http = Net::HTTP.new uri.host, uri.port + end response = http.post '/documents', @input if response.is_a?(Net::HTTPOK) data = JSON.parse(response.body)