Skip to content

Configure directory URL instead of base URL #67

Description

@cneukom

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions