Sha256: 7526a8b32f591a1085daeb7244ae41996f0881f07b77186a280a16580a81bbb2

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

module R509::OCSP::Responder
  class OCSPConfig
    def self.load_config
      config_data = File.read("config.yaml")

      Dependo::Registry[:config_pool] = R509::Config::CAConfigPool.from_yaml("certificate_authorities", config_data)

      Dependo::Registry[:copy_nonce] = YAML.load(config_data)["copy_nonce"] || false

      Dependo::Registry[:cache_headers] = YAML.load(config_data)["cache_headers"] || false

      Dependo::Registry[:max_cache_age] = YAML.load(config_data)["max_cache_age"]

      Dependo::Registry[:ocsp_signer] = R509::OCSP::Signer.new(
        :configs => Dependo::Registry[:config_pool],
        :validity_checker => Dependo::Registry[:validity_checker],
        :copy_nonce => Dependo::Registry[:copy_nonce]
      )
    end

    def self.print_config
      Dependo::Registry[:log].warn "Config loaded"
      Dependo::Registry[:log].warn "Copy Nonce: "+Dependo::Registry[:copy_nonce].to_s
      Dependo::Registry[:log].warn "Cache Headers: "+Dependo::Registry[:cache_headers].to_s
      Dependo::Registry[:log].warn "Max Cache Age: "+Dependo::Registry[:max_cache_age].to_s
      Dependo::Registry[:config_pool].all.each do |config|
        Dependo::Registry[:log].warn "Config: "
        Dependo::Registry[:log].warn "CA Cert:"+config.ca_cert.subject.to_s
        Dependo::Registry[:log].warn "OCSP Cert (may be the same as above):"+config.ocsp_cert.subject.to_s
        Dependo::Registry[:log].warn "OCSP Validity Hours: "+config.ocsp_validity_hours.to_s
        Dependo::Registry[:log].warn "\n"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
r509-ocsp-responder-0.3.3 lib/r509/ocsp/responder/ocsp-config.rb
r509-ocsp-responder-0.3.2 lib/r509/ocsp/responder/ocsp-config.rb