Sha256: 50d827774f241e0cdf1f8a529ae2be854e5383b387ac6d2869b7c72e896e3f51

Contents?: true

Size: 543 Bytes

Versions: 8

Compression:

Stored size: 543 Bytes

Contents

class Acme::Client::Resources::Challenges::TLSSNI01 < Acme::Client::Resources::Challenges::Base
  CHALLENGE_TYPE = 'tls-sni-01'.freeze

  def hostname
    digest = crypto.digest.hexdigest(authorization_key)
    "#{digest[0..31]}.#{digest[32..64]}.acme.invalid"
  end

  def certificate
    self_sign_certificate.certificate
  end

  def private_key
    self_sign_certificate.private_key
  end

  private

  def self_sign_certificate
    @self_sign_certificate ||= Acme::Client::SelfSignCertificate.new(subject_alt_names: [hostname])
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
acme-client-0.3.7 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.6 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.5 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.4 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.3 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.2 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.1 lib/acme/client/resources/challenges/tls_sni01.rb
acme-client-0.3.0 lib/acme/client/resources/challenges/tls_sni01.rb