private Challenge prepareDnsChallenge(Authorization authorization){
  final Dns01Challenge dns01Challenge=authorization.findChallenge(Dns01Challenge.TYPE);
  if (dns01Challenge == null) {
    log.error("Received no challenge from authorization for {}",authorization.getDomain());
    throw new LetsencryptException("Received no challenge");
  }
  final String challengeRecord="_acme-challenge." + authorization.getDomain();
  final String rootZone=dnsResponder.addChallengeRecord(challengeRecord,dns01Challenge.getDigest());
  final DnsRecordObserver observer=new DnsRecordObserver(challengeRecord,rootZone,dns01Challenge.getDigest());
  observer.observeDns();
  return dns01Challenge;
}

private Challenge prepareDnsChallenge ( Authorization authorization ) { final Dns01Challenge dns01Challenge = authorization . findChallenge ( Dns01Challenge . TYPE ) ; if ( dns01Challenge == null ) { log . error ( "Received no challenge from authorization for {}" , authorization . getDomain ( ) ) ; throw new LetsencryptException ( "Received no challenge" ) ; } final String challengeRecord = "_acme-challenge." + authorization . getDomain ( ) ; final String rootZone = dnsResponder . addChallengeRecord ( challengeRecord , dns01Challenge . getDigest ( ) ) ; final DnsRecordObserver observer = new DnsRecordObserver ( challengeRecord , rootZone , dns01Challenge . getDigest ( ) ) ; observer . observeDns ( ) ; return dns01Challenge ; }
creates a dns challenge and calls the dns responder with the challenge data . once this function returns the challenge , it should validate fine .
