summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-07-23 18:07:19 -0700
committerAndre Arko <andre@arko.net>2014-07-23 18:07:19 -0700
commitfb2d989e354d5e95114e5d884b00c0e86cebca86 (patch)
tree7961bbef08d190e408b26c0ca610e3921acc7e28
parent42e4b7570deb35c2dfa76625f68960fe7ab9e742 (diff)
downloadbundler-fb2d989e354d5e95114e5d884b00c0e86cebca86.tar.gz
Require OpenSSL instead of relying on autoload.
Apparently just letting Net::HTTP::Persistent try to autoload OpenSSL doesn’t actually get it loaded on every machine, and then HTTPS requests start to fail. Fixes #3107.
-rw-r--r--lib/bundler/vendored_persistent.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
index bfc69de70e..8ed4ce8306 100644
--- a/lib/bundler/vendored_persistent.rb
+++ b/lib/bundler/vendored_persistent.rb
@@ -1,3 +1,11 @@
+# We forcibly require OpenSSL, because net/http/persistent will only autoload
+# it. On some Rubies, autoload fails but explicit require succeeds.
+begin
+ require 'openssl'
+rescue LoadError
+ # some Ruby builds don't have OpenSSL
+end
+
vendor = File.expand_path('../vendor', __FILE__)
$:.unshift(vendor) unless $:.include?(vendor)
require 'net/http/persistent'