summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-12-01 00:00:36 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-12-01 00:01:12 -0600
commit032203d8f005243be5dd5bfd99abd485b68b567f (patch)
tree15fe1893a1904e1fac97be1b223ab760444a3089 /lib
parent1f10c7f07fdbe5b664272d54657b5687bc881810 (diff)
downloadbundler-032203d8f005243be5dd5bfd99abd485b68b567f.tar.gz
[CompactIndex] Disable when openssl is in fips mode
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/fetcher/compact_index.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 5d703a3a78..5cd8a3e8f1 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -3,10 +3,10 @@ require "bundler/fetcher/base"
require "bundler/worker"
module Bundler
+ autoload :CompactIndexClient, "bundler/compact_index_client"
+
class Fetcher
class CompactIndex < Base
- require "bundler/compact_index_client"
-
def self.compact_index_request(method_name)
method = instance_method(method_name)
undef_method(method_name)
@@ -61,6 +61,7 @@ module Bundler
compact_index_request :fetch_spec
def available?
+ return nil unless md5_available?
user_home = Bundler.user_home
return nil unless user_home.directory? && user_home.writable?
# Read info file checksums out of /versions, so we can know if gems are up to date
@@ -119,6 +120,17 @@ module Bundler
Net::HTTPNotModified.new(nil, nil, nil)
end
end
+
+ def md5_available?
+ begin
+ require "openssl"
+ return false if OpenSSL::OPENSSL_FIPS
+ rescue LoadError
+ nil
+ end
+
+ true
+ end
end
end
end