This pull-request contains minimal code to allow setting custom base URL for a custom directory. That should help testing locally with Pebble and also possibly use with other ACME servers like @zerossl (https://zerossl.com/documentation/acme/).
It now accepts an option baseUri as part of the client initialization, which will override any default URL from LetsEncrypt. That should point to an ACME directory resource. One minor fix had to be made to properly fetch the directory URL pointed by the client, instead of a hardcoded /directory one.
One extra detail was that getting the certificate from Pebble required to first trigger the finalize URL to then poll the order for a certificate. I tried to mimic as much as possible the polling code from validate method.
Last but not less, instead of trying to work only with order ID, guessing the base URL, the code had to preserve and reuse the order URL. That's because the order URL from Pebble has not the same prefix than the new-order URL.
This pull-request contains minimal code to allow setting custom base URL for a custom directory. That should help testing locally with Pebble and also possibly use with other ACME servers like @zerossl (https://zerossl.com/documentation/acme/).
It now accepts an option
baseUri
as part of the client initialization, which will override any default URL from LetsEncrypt. That should point to an ACME directory resource. One minor fix had to be made to properly fetch the directory URL pointed by the client, instead of a hardcoded/directory
one.One extra detail was that getting the certificate from Pebble required to first trigger the finalize URL to then poll the order for a certificate. I tried to mimic as much as possible the polling code from validate method.
Last but not less, instead of trying to work only with order ID, guessing the base URL, the code had to preserve and reuse the order URL. That's because the order URL from Pebble has not the same prefix than the new-order URL.