private function doVerifyChallenge($domain, $token, $payload)
{
if (!is_string($domain)) {
throw new InvalidArgumentException(sprintf("\$domain must be of type string, %s given.", gettype($domain)));
}
if (!is_string($token)) {
throw new InvalidArgumentException(sprintf("\$token must be of type string, %s given.", gettype($token)));
}
if (!is_string($payload)) {
throw new InvalidArgumentException(sprintf("\$payload must be of type string, %s given.", gettype($payload)));
}
$uri = "http://{$domain}/.well-known/acme-challenge/{$token}";
/** @var Response $response */
$response = (yield $this->client->request($uri, [Client::OP_CRYPTO => ["verify_peer" => false, "verify_peer_name" => false]]));
if (rtrim($payload) !== rtrim($response->getBody())) {
throw new AcmeException("selfVerify failed, please check {$uri}.");
}
}