By default, Zentyal uses self-signed certificates for its modules, including the use of the CA module. This situation causes warnings to be displayed, for example, when using mail clients or when accessing the webadmin or webmail. Therefore, this page will show how to generate recognized certificates issued by Let's Encrypt.
The actions I will take for the project are:
I will issue 2 certificates, with one of them having two subdomains:
Webadmin module: arthas.icecrown.es
Mail and webmail module: mail.icecrown.es and webmail.icecrown.es
I will use the HTTP challenge type.
I will use the email account it.infra@icecrown.es as the email address to receive notifications from Let's Encrypt.
Here are the actions to be performed before generating the certificates:
Install the necessary packages for generating certificates.
To generate the certificate for the Webadmin (administration panel), we will use the package python3-certbot-apache instead of python3-certbot-nginx because Zentyal runs Nginx in a customized way, which causes errors when generating certificates.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for arthas.icecrown.es
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/arthas.icecrown.es/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/arthas.icecrown.es/privkey.pem
Your cert will expire on 2023-05-19. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
With the generated certificate, we will need to modify the configuration template (stub) of the module so that this change persists in future updates of the module by Zentyal. To do this, we will create the necessary directories:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mail.icecrown.es
http-01 challenge for webmail.icecrown.es
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/mail.icecrown.es/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/mail.icecrown.es/privkey.pem
Your cert will expire on 2023-05-19. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
With the certificate correctly generated, I will proceed to configure both modules to use it.
## Custom certificates issued on 18-02-2023 by Daniel
# SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
# SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateFile /etc/letsencrypt/live/mail.icecrown.es/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.icecrown.es/privkey.pem
Optionally, I will also add the following configuration parameters to the end of the configuration file. The values of the parameters have been generated from this website.
## Custom configuration applied on 18-02-2023 by Daniel
## https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=intermediate&openssl=1.1.1k&hsts=false&ocsp=false&guideline=5.6
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder off
SSLSessionTickets off
Finally, we confirm that both services are correctly using the new certificate. To perform this action, we can use a mail client like Thunderbird or the openssl command as in my case: