Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Using a clean install of Aegir 3.143 and hosting_https 3.140 under Apache on Ubuntu 16.04.3 LTS, on a publicly available server my.server.com.
Hosting_https module is enabled with Aegir HTTPS Apache, Aegir Let's Encrypt Service and Aegir Self-signed Service
Server is configured to use Let's Encrypt CA with Staging server (but using Production shows same behaviour) and to use Apache HTTPS using standard ports (80 and 443)
When hostmaster site has HTTPS encryption disabled, site verifies fine and works.
I place a simple html file at /var/aegir/config/letsencrypt.d/well-known/acme-challenge/index.html and can access it without problem at http://my.server.com/.well-known/acme-challenge/index.html
I enable HTTPS encryption on the hostmaster site.
Verifying the site then fails with 1 warning :
Failed to generate Let's Encrypt certificates. - warning
and 4 related warnings (fails to copy cert.pem, privkey.pem and fullchain.pem; fails to restart apache as it does not find certificate files) :
copy(/var/aegir/config/letsencrypt.d/my.server.com/cert.pem): failed to open stream: No such file or directory FileSystem.php:19 - warning
copy(/var/aegir/config/letsencrypt.d/my.server.com/privkey.pem): failed to open stream: No such file or directory FileSystem.php:19 - warning
copy(/var/aegir/config/letsencrypt.d/my.server.com/fullchain.pem): failed to open stream: No such file or directory FileSystem.php:19 - warning
apache on my.server.com could not be restarted. Changes might not be available until this has been done. (error: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/conf-enabled/aegir.conf:4 AH00526: Syntax error on line 17 of /var/aegir/config/server_master/apache/vhost.d/my.server.com: SSLCertificateFile: file '/var/aegir/config/server_master/ssl.d/my.server.com/openssl.crt' does not exist or is empty Action 'graceful' failed. The Apache error log may have more information.) - warning
Three files have been created in /var/aegir/config/letsencrypt.d/my.server.com :
-rw------- 1 aegir aegir 1683 Feb 16 18:59 cert-1518807541.csr
-rw------- 1 aegir aegir 0 Feb 16 18:59 cert-1518807541.pem
-rw------- 1 aegir aegir 3243 Feb 16 18:59 privkey-1518807541.pemThe CSR file looks fine and shows the right CN :
openssl req -text -noout -verify -in cert-1518807541.csr
verify OK
Certificate Request:
Data:
Version: 0 (0x0)
Subject: CN=my.server.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (4096 bit)
Modulus:
etc.Certificate
The private key looks fine :
openssl rsa -check -in privkey-1518807541.pem
RSA key ok
writing RSA key
-----BEGIN RSA PRIVATE KEY-----
### etc. ###
-----END RSA PRIVATE KEY-----The third file (the chain?) shows problems :
openssl x509 -text -noout -in cert-1518807541.pem
unable to load certificate
140092606260888:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: TRUSTED CERTIFICATE
I cannot find any logs giving me details about why and how the certificate generation fails. /var/log/aegir is empty. Nothing useful in Apache error logs. Searched for PHP or Dehydrated logs with no success.
If anyone can point me to how to produce and access logs I can research the issue further.










Comments
Comment #2
agaq CreditAttribution: agaq as a volunteer commentedCould anyone give me a hint on how I can produce and access more detailed logs so I can try to understand why letsencrypt certificate generation fails?
I can see in https://www.drupal.org/project/hosting_https/issues/2935425 that one can have more detailed logs but I cannot figure how..
Many thanks.
Comment #3
agaq CreditAttribution: agaq as a volunteer commentedAny hint on how I can try figure out why certificate generation fails?
Any help will be greatly appreciated.
Comment #4
colanI just upgraded myself, and noticed that too. The full Let's Encrypt output doesn't show up in the task log anymore.
I doubt that was intentional, as these are essential for debugging. Let's make it available again.
I ran into this too, but it seemed to work after disabling HTTPS on the site, verifying it, and then enabling it again.
In any case, we need that log output back.
Comment #5
agaq CreditAttribution: agaq as a volunteer commentedDisabling HTTPS on the site, verifying it, and then enabling it again did not work for me.
Tried also to revert server to Certificate=None then back to Certificate=LetsEncrypt, but certificate generation still fails.
I will resume testing and researching once we have log output back.
Comment #6
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI have had this issue with providing ssl to my aegir system and to a remote site
Here is what I get when I run verify from the command line
(drush hosting-task --debug --force verify-task-id)
Comment #7
agaq CreditAttribution: agaq as a volunteer commentedMany thanks @SocialNicheGuru for the info on how to re-run a task on the command line in a verbose manner. :-)
I did that and it pointed immediately to my problem: I had an alternative name 'my.alternate.name' for the site but the DNS record for ' my.alternate.name' was a CName instead of an A record:
When I remove the domain alias or change it from a CName to an A Record, then all works fine.
I have found mentions of the need for an A record in the LetsEncrypt documentation, but not overly prominent and evident.
I will suggest in a separate ticket some changes in the documentation to help clarify the need for an A Record.
Comment #8
agaq CreditAttribution: agaq as a volunteer commented@SocialNicheGuru:
Your log shows a URI for your certificate at https://acme-v01.api.letsencrypt.org/acme/challenge/FngEg1o2GOKK71ka-wMT...
This URI shows that the ACME challenge it needs to access is expected to be at http://www.insiteapps.socialnicheguru.com/.well-known/acme-challenge/fRz...
But there is nothing at this address
Have you removed it or was it never there?
Have you checked that files in your /.well-known/acme-challenge/ are accessible? - see
See in https://matteobrusa.github.io/md-styler/?url=cgit.drupalcode.org/hosting...
Comment #9
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI am creating a site on a remote server where both the apache2 and mysql servers for the site are.
There is no config directory on that machine.
There is no .well-known directory on the remote server.
There are config and .well-known directories on the master server
Is there a problem with deploying letsencyrpt on a remote server?
Comment #10
Jon PughI received the same warning after installing this, with no further information.
"Failed to generate Let's Encrypt certificates." needs to be more descriptive, and help users figure out what's wrong.
Might want to add a pre_hosting_task to check if the library is available.
Comment #11
colanWe need to get #2952411: Restore Let's Encrypt log output in Verify tasks fixed first.
Comment #12
g33kg1rl CreditAttribution: g33kg1rl commented-
Comment #13
colanThe prerequisite is fixed. Can someone post their logs (as an attachment if very long) for this after re-enabling full logging? That will give us the much needed information.