private Http01Challenge httpChallenge(Authorization auth) throws AcmeException { // Find a single http-01 challenge Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); if (challenge == null) { throw new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do..."); } // Output the challenge, wait for acknowledge... log.debug("http://{}/.well-known/acme-challenge/{}", auth.getIdentifier().getDomain(), challenge.getToken()); log.debug("Content: {}", challenge.getAuthorization()); return challenge; }
public String getAuthContent() { Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); return challenge.getAuthorization(); }
public String getToken() { Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); return challenge.getToken(); }
private Challenge httpChallenge(final Authorization auth) throws AcmeException { final Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); if (challenge == null) { throw new AcmeException("Challenge is null"); } challengeUpdater.accept("/.well-known/acme-challenge/" + challenge.getToken(), challenge.getAuthorization()); return challenge; }
private CompletableFuture<Void> processChallenge(Authorization auth) { //TODO: We should DUMP EACH Challenge into it's own Runnable so we do challenges in parallel try { Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); log.info("tell remote end to trigger a call now. status="+auth.getStatus()+" domain="+auth.getDomain()+" expires="+auth.getExpires()); challenge.trigger(); log.info("status after="+auth.getStatus()); while (auth.getStatus() != Status.VALID) { //HACK for now....modify to catch RetryAfterException and schedule future Thread.sleep(3000L); log.info("reupdate status"); auth.update(); log.info("updated to status="+auth.getStatus()); } return null; } catch (AcmeException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } }
Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE); if (challenge == null) { throw new AcmeException("Found no " + Dns01Challenge.TYPE + " challenge, don't know what to do...");
Http01Challenge challenge = auth.findChallenge(Http01Challenge.TYPE); if (challenge == null) { throw new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do...");
@Override public Tuple2<Order, Dns01Challenge> challengeInit(String domainName) { AssertTools.assertNotNull(account, "You need to log in first"); Order order; try { order = account.newOrder() // .domains(domainName) // .create(); } catch (AcmeException e) { LOGGER.error("Could not ask for domain {}", domainName, e); throw new LetsencryptException("Could not ask for domain " + domainName, e); } // Get the DNS challenge Dns01Challenge challenge = null; List<String> availableChallenges = new ArrayList<>(); for (Authorization auth : order.getAuthorizations()) { auth.getChallenges().stream().map(it -> it.getType()).forEach(it -> availableChallenges.add(it)); challenge = auth.findChallenge(Dns01Challenge.TYPE); } if (challenge == null) { throw new LetsencryptException("DNS Challenge not found for " + domainName + " ; Available challenges are: [" + Joiner.on(", ").join(availableChallenges) + "]"); } return new Tuple2<>(order, challenge); }
/** * Prepares a HTTP challenge. * <p> * The verification of this challenge expects a file with a certain content to be * reachable at a given path under the domain to be tested. * </p> * * @param aAuthorization * {@link Authorization} to find the challenge in * @param aDomainName * Domain name to be authorized * @return {@link Challenge} to verify */ private Challenge httpChallenge(Authorization aAuthorization, String aDomainName) throws AcmeException { // Find a single http-01 challenge Http01Challenge challenge = aAuthorization.findChallenge(Http01Challenge.TYPE); if (challenge == null) { throw new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do..."); } challengeStore.put(challenge.getToken(), challenge.getAuthorization()); return challenge; }
Authorization auth = reg.authorizeDomain(domain); messages.add("find http challenge", LOG); Http01Challenge challenge1 = auth.findChallenge(Http01Challenge.TYPE); if (challenge1 == null) { throw new AcmeException("Found no " + Http01Challenge.TYPE + " challenge, don't know what to do...");