Skip to content

Commit ede5e99

Browse files
Merge pull request #1 from shellrent/dnschallenge-fix
Fixed DNS-01 and HTTP-01 challenges
2 parents ecb4787 + df7150f commit ede5e99

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/LEFunctions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ public static function checkDNSChallenge($domain, $DNSDigest)
235235
{
236236
if($answer->type === 16)
237237
{
238+
/* Since May 19th, this check always fails because the comparison should take place without the quotes; let's keep both just to be sure */
238239
if($answer->data === ('"' . $DNSDigest . '"')) return true;
240+
if($answer->data === $DNSDigest) return true;
239241
}
240242
}
241243
}

src/LEOrder.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class LEOrder
5151
public $expires;
5252
public $identifiers;
5353
private $authorizationURLs;
54+
/** @var LEAuthorization[] */
5455
public $authorizations;
5556
public $finalizeURL;
5657
public $certificateURL;
@@ -414,11 +415,27 @@ public function verifyPendingOrderAuthorization($identifier, $type, $localcheck
414415
}
415416
elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('HTTP challenge for \'' . $identifier . '\' valid.', 'function verifyPendingOrderAuthorization');
416417
}
418+
419+
$i = 1;
420+
417421
while($auth->status == 'pending')
418422
{
423+
if( $i > 6 )
424+
{
425+
break;
426+
}
427+
419428
sleep(1);
420429
$auth->updateData();
430+
431+
$i++;
432+
}
433+
434+
if($auth->status == 'pending')
435+
{
436+
return false;
421437
}
438+
422439
return true;
423440
}
424441
}
@@ -447,11 +464,27 @@ public function verifyPendingOrderAuthorization($identifier, $type, $localcheck
447464
}
448465
elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('DNS challenge for \'' . $identifier . '\' valid.', 'function verifyPendingOrderAuthorization');
449466
}
467+
468+
$i = 1;
469+
450470
while($auth->status == 'pending')
451471
{
472+
if( $i > 6 )
473+
{
474+
break;
475+
}
476+
452477
sleep(1);
453478
$auth->updateData();
479+
480+
$i++;
481+
}
482+
483+
if($auth->status == 'pending')
484+
{
485+
return false;
454486
}
487+
455488
return true;
456489
}
457490
}

0 commit comments

Comments
 (0)