/** * Returns the digest string to be set in the domain's {@code _acme-challenge} TXT * record. */ public String getDigest() { return base64UrlEncode(sha256hash(getAuthorization())); }
@Override public void challengeComplete(Dns01Challenge challenge) { AssertTools.assertNotNull(account, "You need to log in first"); // Trigger the challenge try { LOGGER.info("Triggering the challenge"); challenge.trigger(); } catch (AcmeException e) { LOGGER.error("Problem triggering the challenge", e); throw new LetsencryptException("Problem triggering the challenge: " + challenge.getError().getDetail(), e); } // Wait until completed while (challenge.getStatus() != Status.VALID) { if (challenge.getStatus() == Status.INVALID) { throw new LetsencryptException("The challenge failed: " + challenge.getError().getDetail()); } ThreadTools.sleep(5 * 1000); // 5 secs try { LOGGER.info("Updating the status"); challenge.update(); } catch (AcmeException e) { LOGGER.error("Problem updating the challenge status", e); throw new LetsencryptException("Problem updating the challenge status: " + challenge.getError().getDetail(), e); } LOGGER.info("Current status: {}", challenge.getStatus()); } }
Dns01Challenge dnsChallenge = orderAndDnsChallenge.getB(); challengeByDomain.put(domain, orderAndDnsChallenge); String digest = dnsChallenge.getDigest();
/** * Returns the digest string to be set in the domain's {@code _acme-challenge} TXT * record. */ public String getDigest() { return base64UrlEncode(sha256hash(getAuthorization())); }