Class: OpenSSL::X509::Store

Inherits:
Object show all
Defined in:
lib/puppet/util/monkey_patches.rb

Instance Method Summary collapse

Instance Method Details

#__original_set_default_pathsObject


64
# File 'lib/puppet/util/monkey_patches.rb', line 64

alias __original_set_default_paths set_default_paths

#set_default_pathsObject


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/puppet/util/monkey_patches.rb', line 65

def set_default_paths
  # This can be removed once openssl integrates with windows
  # cert store, see https://rt.openssl.org/Ticket/Display.html?id=2158
  unless @puppet_certs_loaded
    @puppet_certs_loaded = true

    Puppet::Util::Windows::RootCerts.instance.to_a.uniq { |cert| cert.to_der }.each do |x509|
      begin
        add_cert(x509)
      rescue OpenSSL::X509::StoreError
        warn "Failed to add #{x509.subject.to_utf8}"
      end
    end
  end

  __original_set_default_paths
end