public Instant getExpires() { return auth.getExpires(); }
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); } }
private void checkAuthStatii(Order order) { for(Authorization auth : order.getAuthorizations()) { Status status = auth.getStatus(); log.info("checking auth="+auth.getDomain()+" status="+status+" location="+auth.getLocation()+" expires="+auth.getExpires()); if(status != Status.PENDING) throw new ChallengeInBadStateException("challenge in bad state="+auth.getJSON()); } }