According to RFC 8555 Section 7.1.1, an ACME server can put the directory resource wherever it likes:
In order to help clients configure themselves with the right URLs for
each ACME operation, ACME servers provide a directory object. This
should be the only URL needed to configure clients. [...]
There is no constraint on the URL of the directory except that it
should be different from the other ACME server resources' URLs, and
that it should not clash with other services. [...]
However, the Directory endpoint hard-codes it currently to /directory. Would it be possible to make the URL of the Directory endpoint configurable? This would enable the use of this library with arbitrary ACME servers, and particularly the use of Pebble for integration testing :)
In order not to introduce a breaking-change, I'd suggest to simply add a configuration option for the directory path to the Api constructor:
public function __construct(
bool $staging = false,
private ?AcmeAccountInterface $localAccount = null,
private ?LoggerInterface $logger = null,
private ?HttpClientInterface $httpClient = null,
private ?string $baseUrl = null,
private string $directoryPath = '/directory',
) {
If interested, I'm happy to create a PR for this.
According to RFC 8555 Section 7.1.1, an ACME server can put the directory resource wherever it likes:
However, the Directory endpoint hard-codes it currently to
/directory. Would it be possible to make the URL of the Directory endpoint configurable? This would enable the use of this library with arbitrary ACME servers, and particularly the use of Pebble for integration testing :)In order not to introduce a breaking-change, I'd suggest to simply add a configuration option for the directory path to the
Apiconstructor:If interested, I'm happy to create a PR for this.