lib/berkshelf/ssl_policies.rb in berkshelf-7.1.0 vs lib/berkshelf/ssl_policies.rb in berkshelf-7.2.0
- old
+ new
@@ -1,6 +1,6 @@
-require "openssl"
+require "openssl" unless defined?(OpenSSL)
module Berkshelf
class SSLPolicy
# @return [Store]
@@ -27,14 +27,12 @@
config_dir
end
end
def set_custom_certs
- Dir.chdir(trusted_certs_dir) do
- ::Dir.glob("{*.crt,*.pem}").each do |cert|
- cert = OpenSSL::X509::Certificate.new(IO.read(cert))
- add_trusted_cert(cert)
- end
+ ::Dir.glob("#{trusted_certs_dir}/{*.crt,*.pem}").each do |cert|
+ cert = OpenSSL::X509::Certificate.new(IO.read(cert))
+ add_trusted_cert(cert)
end
end
end
end