lib/AcmeService.php
public function requestChallenges(string $dns): Promise {
        return call(function () use ($dns) {
            /** @var Response $response */
            $response = yield $this->acmeClient->post(AcmeResource::NEW_AUTHORIZATION, [
                'identifier' => [
                    'type' => 'dns',
                    'value' => $dns,
                ],
            ]);

            if ($response->getStatus() === 201) {
                if (!$response->hasHeader('location')) {
                    throw new AcmeException("Protocol violation: Response didn't carry any location header.");
                }

                return [$response->getHeader('location'), json_decode(yield $response->getBody())];
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function requestChallenges(string $dns): Promise {
        return call(function () use ($dns) {
            /** @var Response $response */
            $response = yield $this->acmeClient->post(AcmeResource::NEW_AUTHORIZATION, [
                'identifier' => [
                    'type' => 'dns',
                    'value' => $dns,
                ],
            ]);

            if ($response->getStatus() === 201) {
                if (!$response->hasHeader('location')) {
                    throw new AcmeException("Protocol violation: Response didn't carry any location header.");
                }

                return [$response->getHeader('location'), json_decode(yield $response->getBody())];
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function requestChallenges ( string $ dns ) : Promise { return call ( function ( ) use ( $ dns ) { /** @var Response $response */ $ response = yield $ this -> acmeClient -> post ( AcmeResource :: NEW_AUTHORIZATION , [ 'identifier' => [ 'type' => 'dns' , 'value' => $ dns , ] , ] ) ; if ( $ response -> getStatus ( ) === 201 ) { if ( ! $ response -> hasHeader ( 'location' ) ) { throw new AcmeException ( "Protocol violation: Response didn't carry any location header." ) ; } return [ $ response -> getHeader ( 'location' ) , json_decode ( yield $ response -> getBody ( ) ) ] ; } throw $ this -> generateException ( $ response , yield $ response -> getBody ( ) ) ; } ) ; }
Requests challenges for a given DNS name.

@api

@param string $dns DNS name to request challenge for

@return Promise resolves to an array of challenges
@throws AcmeException If something went wrong.
Requests challenges for a given DNS name .