Class: Acme::Client::Resources::Challenges::HTTP01
- Inherits:
-
Base
- Object
- Base
- Acme::Client::Resources::Challenges::HTTP01
show all
- Defined in:
- lib/acme/client/resources/challenges/http01.rb
Constant Summary
collapse
- CONTENT_TYPE =
'text/plain'.freeze
Instance Attribute Summary
Attributes inherited from Base
#client, #error, #status, #token, #uri
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #verify_status
Instance Method Details
#content_type ⇒ Object
4
5
6
|
# File 'lib/acme/client/resources/challenges/http01.rb', line 4
def content_type
CONTENT_TYPE
end
|
#file_content ⇒ Object
8
9
10
|
# File 'lib/acme/client/resources/challenges/http01.rb', line 8
def file_content
authorization_key
end
|
#filename ⇒ Object
12
13
14
|
# File 'lib/acme/client/resources/challenges/http01.rb', line 12
def filename
".well-known/acme-challenge/#{token}"
end
|
#request_verification ⇒ Object
16
17
18
19
|
# File 'lib/acme/client/resources/challenges/http01.rb', line 16
def request_verification
response = client.connection.post(@uri, { resource: 'challenge', type: 'http-01', keyAuthorization: authorization_key })
response.success?
end
|