begin
p 'Querying ACME challenge record'
result = res.query_no_validation_or_recursion( "_acme-challenge." + domain, "TXT" )
- p result
+ # p result
propagated = result.answer.any? do |answer|
answer.rdata[0] == challenge.record_content
end
p "Creating order object for cert #{cert_name}"
order = client.new_order(identifiers: cert_opts['domain_names'] )
+ p 'order status'
+ p order.status
if order.status != 'ready'
p 'Order is not ready, we need to authorize first'
order.authorizations.each do |auth|
p "Processing authorization for #{auth.domain}"
p "Finding challenge type for #{auth.domain}"
+ if auth.status == 'valid'
+ p "Authorization for #{auth.domain} is still valid, skipping"
+ next
+ end
+
challenge = auth.dns01
deploy_dns01_challenge_token( auth.domain, challenge, config['domains'][auth.domain]['primary_ns'], config )
wait_for_challenge_propagation( auth.domain, challenge )