Sha256: 0ef1b5e1492959946178011a0e2c800e6b45c2639abdd48a1b9332995469fbe6

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'rubygems'
require 'rack'

require 'certmeister'
require 'certmeister/redis/store'
require 'certmeister/rack/app'
require 'redis'

store = Certmeister::Redis::Store.new(Redis.new, "development")

sign_policy = Certmeister::Policy::ChainAny.new([
  Certmeister::Policy::ChainAll.new([
    Certmeister::Policy::Existing.new(store),
    Certmeister::Policy::Domain.new(['host-h.net']),
    Certmeister::Policy::Fcrdns.new,
  ]),
  Certmeister::Policy::ChainAll.new([
    Certmeister::Policy::Existing.new(store),
    Certmeister::Policy::Domain.new(['example.com']),
    Certmeister::Policy::IP.new(['192.168.0.0/23']),
  ]),
  Certmeister::Policy::IP.new(['127.0.0.1/32']),
])
fetch_policy = Certmeister::Policy::Noop.new
remove_policy = Certmeister::Policy::IP.new(['192.168.0.0/23', '127.0.0.1/32'])

ca = Certmeister.new(
  Certmeister::Config.new(
    sign_policy: sign_policy,
    fetch_policy: fetch_policy,
    remove_policy: remove_policy,
    store: store,
    ca_cert: File.read("../fixtures/ca.crt"),
    ca_key: File.read("../fixtures/ca.key"),
  )
)
certmeister = Certmeister::Rack::App.new(ca)

app = Rack::Builder.new do
  map "/ca" do
    run certmeister
  end
end

run app

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
certmeister-2.0.0 contrib/config.ru
certmeister-1.2.1 contrib/config.ru
certmeister-1.2.0 contrib/config.ru
certmeister-1.1.0 contrib/config.ru
certmeister-1.0.1 contrib/config.ru
certmeister-1.0.0 contrib/config.ru