private function requestNonce(string $uri): Promise {
        return call(function () use ($uri) {
            $request = new Request($uri, 'HEAD');

            try {
                /** @var Response $response */
                $response = yield $this->http->request($request, [
                    Client::OP_DISCARD_BODY => true,
                ]);

                if (!$response->hasHeader('replay-nonce')) {
                    throw new AcmeException("HTTP response didn't carry replay-nonce header.");
                }

                return $response->getHeader('replay-nonce');
            } catch (HttpException $e) {
                throw new AcmeException("HEAD request to {$uri} failed, could not obtain a replay nonce: " . $e->getMessage(), null, $e);
            }
        });
    }