Skip to content
Browse files

fixing for OpenSSL backward compatibility with Ruby 1.8.7 version

  • Loading branch information...
1 parent 532feb7 commit 02450cfc00e94c554b8f74cad6dbe109e56c0f2c @guedes guedes committed Jul 16, 2011
Showing with 6 additions and 4 deletions.
  1. +1 −0 lib/pgxn_utils.rb
  2. +5 −4 lib/pgxn_utils/cli.rb
View
1 lib/pgxn_utils.rb
@@ -3,6 +3,7 @@
require 'zip/zip'
require 'zippy'
require 'net/http/post/multipart'
+require 'net/https'
require 'highline/import'
module PgxnUtils
View
9 lib/pgxn_utils/cli.rb
@@ -145,10 +145,11 @@ def prepare_multipart_post_for(filename)
def try_send_file(request, filename)
begin
- Net::HTTP.start(UPLOAD_URL.host, UPLOAD_URL.port, { :use_ssl => true , :verify_mode => OpenSSL::SSL::VERIFY_NONE }) do |http|
- say "Trying to release #{File.basename(filename)} ... "
- http.request(request)
- end
+ http = Net::HTTP.new(UPLOAD_URL.host, UPLOAD_URL.port)
+ http.use_ssl = true
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ say "Trying to release #{File.basename(filename)} ... "
+ http.request(request)
rescue SocketError
say "Please, check your connection.", :red
exit(1)

0 comments on commit 02450cf

Please sign in to comment.
Something went wrong with that request. Please try again.