Class: Bullion::ChallengeClients::HTTP
Overview
ACME HTTP01 Challenge Client
Constant Summary
Bullion::ChallengeClient::ChallengeClientMetric
Instance Attribute Summary
#challenge
Class Method Summary
collapse
Instance Method Summary
collapse
#attempt, #identifier, #initialize
Class Method Details
.acme_type ⇒ Object
8
|
# File 'lib/bullion/challenge_clients/http.rb', line 8
def self.acme_type = "http-01"
|
Instance Method Details
#challenge_url ⇒ Object
23
24
25
|
# File 'lib/bullion/challenge_clients/http.rb', line 23
def challenge_url
"http://#{identifier}/.well-known/acme-challenge/#{challenge.token}"
end
|
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/bullion/challenge_clients/http.rb', line 11
def perform
response = begin
retrieve_body(challenge_url)
rescue SocketError
LOGGER.debug "Failed to connect to #{challenge_url}"
""
end
token, thumbprint = response.split(".")
token == challenge.token && thumbprint == challenge.thumbprint
end
|
#retrieve_body(url) ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/bullion/challenge_clients/http.rb', line 27
def retrieve_body(url)
HTTParty.get(
url,
verify: false,
headers: { "User-Agent" => "Bullion/#{Bullion::VERSION}" }
).body
end
|
#type ⇒ Object
9
|
# File 'lib/bullion/challenge_clients/http.rb', line 9
def type = "HTTP01"
|