Class: Acme::Client::Resources::Challenges::TLSSNI01

Inherits:
Base
  • Object
show all
Defined in:
lib/acme/client/resources/challenges/tls_sni01.rb

Constant Summary collapse

CHALLENGE_TYPE =
'tls-sni-01'.freeze
DIGEST =
OpenSSL::Digest::SHA256

Instance Attribute Summary

Attributes inherited from Base

#authorization, #error, #status, #token, #uri

Instance Method Summary collapse

Methods inherited from Base

#assign_attributes, #client, #initialize, #request_verification, #verify_status

Constructor Details

This class inherits a constructor from Acme::Client::Resources::Challenges::Base

Instance Method Details

#certificateObject



12
13
14
# File 'lib/acme/client/resources/challenges/tls_sni01.rb', line 12

def certificate
  self_sign_certificate.certificate
end

#hostnameObject



7
8
9
10
# File 'lib/acme/client/resources/challenges/tls_sni01.rb', line 7

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

#private_keyObject



16
17
18
# File 'lib/acme/client/resources/challenges/tls_sni01.rb', line 16

def private_key
  self_sign_certificate.private_key
end