class Jekyll::Gitlab::Letsencrypt::Acme

Attributes

registration[RW]

Public Instance Methods

authorized?() click to toggle source
# File lib/jekyll/gitlab/letsencrypt/acme.rb, line 20
def authorized?
  authorization.status == 'valid'
end
challenge() click to toggle source
# File lib/jekyll/gitlab/letsencrypt/acme.rb, line 24
def challenge
  @challenge ||= authorization.http01
end
client() click to toggle source
# File lib/jekyll/gitlab/letsencrypt/acme.rb, line 28
def client
  @client ||= begin
    private_key = OpenSSL::PKey::RSA.new(4096)
    ::Acme::Client.new private_key: private_key, endpoint: endpoint, connection_options: { request: { open_timeout: 5, timeout: 5 } }
  end
end
register!() click to toggle source
# File lib/jekyll/gitlab/letsencrypt/acme.rb, line 13
def register!
  Jekyll.logger.info "Registering #{email} to #{endpoint}..."
  @registration = client.register contact: "mailto:#{email}"
  @registration.agree_terms
  self
end

Private Instance Methods

authorization() click to toggle source
# File lib/jekyll/gitlab/letsencrypt/acme.rb, line 37
def authorization
  @authorization ||= client.authorize(domain: domain)
end