lib/AcmeService.php
public function answerChallenge(string $location, string $keyAuth): Promise {
        return call(function () use ($location, $keyAuth) {
            /** @var Response $response */
            $response = yield $this->acmeClient->post($location, [
                'resource' => AcmeResource::CHALLENGE,
                'keyAuthorization' => $keyAuth,
            ]);

            if ($response->getStatus() === 202) {
                return json_decode(yield $response->getBody());
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function answerChallenge(string $location, string $keyAuth): Promise {
        return call(function () use ($location, $keyAuth) {
            /** @var Response $response */
            $response = yield $this->acmeClient->post($location, [
                'resource' => AcmeResource::CHALLENGE,
                'keyAuthorization' => $keyAuth,
            ]);

            if ($response->getStatus() === 202) {
                return json_decode(yield $response->getBody());
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function answerChallenge ( string $ location , string $ keyAuth ) : Promise { return call ( function ( ) use ( $ location , $ keyAuth ) { /** @var Response $response */ $ response = yield $ this -> acmeClient -> post ( $ location , [ 'resource' => AcmeResource :: CHALLENGE , 'keyAuthorization' => $ keyAuth , ] ) ; if ( $ response -> getStatus ( ) === 202 ) { return json_decode ( yield $ response -> getBody ( ) ) ; } throw $ this -> generateException ( $ response , yield $ response -> getBody ( ) ) ; } ) ; }
Answers a challenge and signals that the CA should validate it.

@api

@param string $location URI of the challenge
@param string $keyAuth key authorization

@return Promise resolves to the decoded JSON response
@throws AcmeException If something went wrong.
Answers a challenge and signals that the CA should validate it .