fbett / le-acme2-php

LetsEncrypt client library for ACME v2 written in PHP.
MIT License
30 stars 15 forks source link

Not creating keys? #8

Closed mikaelstaer closed 4 years ago

mikaelstaer commented 4 years ago

I've taken the sample file and am not able to get it working – no key files are created, and it looks like the certificate is not created at LetsEncrypt. Am I missing something? Some kind of permissions that need to be set?

It would also be great to see the code for the described "integrated workflow" as I am attempting to create the same functionality.

fbett commented 4 years ago

Hi,

as there are no known generally issues with the library, i would suggest to enable the debug logger of this library.

Additional the php error output should be enabled by prepending:

error_reporting(E_ALL | E_NOTICE | E_STRICT);
ini_set("display_errors", "on");

About the "integrated workflow", as it depends about your config panel implementation, it's difficult to assist. But let's assume, i have the following components:

  1. Cronjob: This cronjob is building the Apache/Nginx config files. This cronjob also knows about the previously generated config files and will automatically reload the Apache/Nginx server, if the files differ. This cronjob is running at root to be able to restart the services and to read/write to the ssl certificate storage.

  2. Implementation: There is a class Domain with an attribute: "isSSLEnabled". If this attribute is set to "true", a method $domain->getSSLCertificateBundle() will be called. The method body is quite equal to the sample file. If $order->isCertificateBundleAvailable() returns "true", the bundle will be returned or null. If a bundle was returned, the cronjob will add the needed parts to get a valid ssl configuration otherwise the ssl configuration is removed from the Apache/Nginx config file.