Class: Bullion::ChallengeClients::HTTP
- Inherits:
-
Bullion::ChallengeClient
- Object
- Bullion::ChallengeClient
- Bullion::ChallengeClients::HTTP
- Defined in:
- lib/bullion/challenge_clients/http.rb
Overview
ACME HTTP01 Challenge Client
Direct Known Subclasses
Constant Summary
Constants inherited from Bullion::ChallengeClient
Bullion::ChallengeClient::ChallengeClientMetric
Instance Attribute Summary
Attributes inherited from Bullion::ChallengeClient
Instance Method Summary collapse
Methods inherited from Bullion::ChallengeClient
#attempt, #identifier, #initialize
Constructor Details
This class inherits a constructor from Bullion::ChallengeClient
Instance Method Details
#challenge_url ⇒ Object
24 25 26 |
# File 'lib/bullion/challenge_clients/http.rb', line 24 def challenge_url "http://#{identifier}/.well-known/acme-challenge/#{challenge.token}" end |
#perform ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bullion/challenge_clients/http.rb', line 12 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
28 29 30 31 32 33 34 |
# File 'lib/bullion/challenge_clients/http.rb', line 28 def retrieve_body(url) HTTParty.get( url, verify: false, headers: { "User-Agent" => "Bullion/#{Bullion::VERSION}" } ).body end |
#type ⇒ Object
8 9 10 |
# File 'lib/bullion/challenge_clients/http.rb', line 8 def type "HTTP01" end |