23: def x509store
24: unless File.exist?(Puppet[:cacrl])
25:
26: return nil
27: end
28: crl = OpenSSL::X509::CRL.new(File.read(Puppet[:cacrl]))
29: store = OpenSSL::X509::Store.new
30: store.purpose = OpenSSL::X509::PURPOSE_ANY
31: store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK if Puppet.settings[:certificate_revocation]
32: raise Puppet::Error, "Could not find CA certificate" unless self.ca_cert
33:
34: store.add_file(Puppet[:localcacert])
35: store.add_crl(crl)
36: store
37: end