Certbot fa parte dello sforzo di EFF per crittografare l'intera Internet. La comunicazione sicura sul Web si basa su HTTPS, che richiede l'uso di un certificato digitale che consente ai browser di verificare l'identità dei server Web (ad esempio, è davvero google.com?). I server Web ottengono i loro certificati da terze parti fidate chiamate autorità di certificazione (CA). Certbot è un client facile da usare che recupera un certificato da Let's Encrypt, un'autorità di certificazione aperta lanciata da EFF, Mozilla e altri, e lo distribuisce a un server Web.
Chiunque abbia avuto il problema di creare un sito Web sicuro sa quanto sia una seccatura ottenere e mantenere un certificato. Certbot e Let's Encrypt possono automatizzare il dolore e consentirti di attivare e gestire HTTPS con semplici comandi. L'utilizzo di Certbot e Let's Encrypt è gratuito, quindi non è necessario organizzare il pagamento.
Installazione di CertBot:
sudo apt update && sudo apt install certbot python-certbot-apache
Se il comando non funziona, prova questo:sudo apt install certbot python3-certbot-apache
Ora otteniamo il nostro nuovo certificato CertBot
sudo certbot --apache
Ti verranno poste alcune domande come la tua email, accetti i Termini di servizio e così via. Per favore compilali per le tue esigenze.
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):
Enter an email address where you can be contacted in case of urgent renewal and security notices.
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel:
Press a and ENTER to agree to the Terms of Service.
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o:
Press n and ENTER to not share your email address with EFF.
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: example.com
2: www.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Code language: PHP (php)
Ora testiamo il nostro certificato
Il sito ssllabs.com/ssltest/ è perfetto per i test

Rinnovo automatico
Poiché i certificati Let's Encrypt scadono dopo 90 giorni, devono essere controllati periodicamente per il rinnovo. Certbot verrà eseguito automaticamente due volte al giorno e rinnoverà qualsiasi certificato entro trenta giorni dalla scadenza.
Per verificare che questo processo di rinnovo funzioni correttamente, puoi eseguire:
sudo certbot renew --dry-run
Conclusione
In conclusione Certbot è uno dei migliori strumenti per il lavoro. È automatico, è gratuito e per di più è molto facile da installare e mantenere.