Skip to content

Commit

Permalink
Merge pull request #1 from shellrent/dnschallenge-fix
Browse files Browse the repository at this point in the history
Fixed DNS-01 and HTTP-01 challenges
  • Loading branch information
svdigital-development authored May 20, 2021
2 parents ecb4787 + df7150f commit ede5e99
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/LEFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ public static function checkDNSChallenge($domain, $DNSDigest)
{
if($answer->type === 16)
{
/* Since May 19th, this check always fails because the comparison should take place without the quotes; let's keep both just to be sure */
if($answer->data === ('"' . $DNSDigest . '"')) return true;
if($answer->data === $DNSDigest) return true;
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions src/LEOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LEOrder
public $expires;
public $identifiers;
private $authorizationURLs;
/** @var LEAuthorization[] */
public $authorizations;
public $finalizeURL;
public $certificateURL;
Expand Down Expand Up @@ -414,11 +415,27 @@ public function verifyPendingOrderAuthorization($identifier, $type, $localcheck
}
elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('HTTP challenge for \'' . $identifier . '\' valid.', 'function verifyPendingOrderAuthorization');
}

$i = 1;

while($auth->status == 'pending')
{
if( $i > 6 )
{
break;
}

sleep(1);
$auth->updateData();

$i++;
}

if($auth->status == 'pending')
{
return false;
}

return true;
}
}
Expand Down Expand Up @@ -447,11 +464,27 @@ public function verifyPendingOrderAuthorization($identifier, $type, $localcheck
}
elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('DNS challenge for \'' . $identifier . '\' valid.', 'function verifyPendingOrderAuthorization');
}

$i = 1;

while($auth->status == 'pending')
{
if( $i > 6 )
{
break;
}

sleep(1);
$auth->updateData();

$i++;
}

if($auth->status == 'pending')
{
return false;
}

return true;
}
}
Expand Down

0 comments on commit ede5e99

Please sign in to comment.