En esta entrada vamos a crear certificados gratuitos y firmados con let’s encrypt:
¿Qué es Let’s Encrypt?

Para quien no lo conozca, let’s encrypt es la nueva autoridad de certificación gratuita de moda. Un proyecto conjunto que pretende hacer más seguro internet y al que ya se han unido patrocinadores tan importantes como Google, Facebook, Cisco o Mozilla.
Instalación
Para desplegar Let’s Encrypt en nuestro sistema tenemos diferentes posibilidades, aunque es condición común el tener un servidor web que
escuche en el puerto 80 o 443 y que sirva el nombre que queremos firmar.
Si disponemos de una debian Jessie, Sid o Stretch podemos directamente instalar los paquetes correspondientes:
[shell]
$ apt-get install letsencrypt python-letsencrypt-apache
[/shell]
Sin embargo, en debian Wheezy o anteriores debemos hacer esto de modo manual.
[shell]
# Elegimos un directorio para descargar el código.
$ cd /usr/src/
# Obtenemos el código con git
$ git clone https://github.com/letsencrypt/letsencrypt
# Entramos en el directorio creado
$ cd letsencrypt/
[/shell]
Obtención del certificado
A partir de ahora podremos crear los certificados con la siguiente orden:
[shell]
$ ./letsencrypt-auto certonly –webroot -w [Directorio raíz de la web] -d [nombre a registrar]
# Por ejemplo: ./letsencrypt-auto certonly –webroot -w /var/www/www.milinux.es/html/ -d www.milinux.es
[/shell]
[plain gutter=»false»]
Updating letsencrypt and virtual environment dependencies……
Requesting root privileges to run with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt certonly –webroot -w /var/www/www.milinux.es/html/ -d www.milinux.es
IMPORTANT NOTES:
– Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/www.milinux.es/fullchain.pem. Your cert will
expire on 2016-02-14. To obtain a new version of the certificate in
the future, simply run Let’s Encrypt again.
– If you like Let’s Encrypt, please consider supporting our work by:
Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
[/plain]
Esto nos creará dentro del directorio /etc/letsencrypt/archive/[nombre a registrar]/ los diferentes ficheros del certificado:
cert1.pem, chain1.pem fullchain1.pem y privkey1.pem
que serán los que utilizaremos para nuestro sitio web.
En site.conf de apache2.2 quedaría una configuración de este estilo:
[plain]
SSLEngine on
SSLCertificateFile /etc/letsencrypt/archive/www.milinux.es/cert1.pem
SSLCertificateChainFile /etc/letsencrypt/archive/www.milinux.es/chain1.pem
SSLCertificateKeyFile /etc/letsencrypt/archive/www.milinux.es/privkey1.pem
[/plain]
[shell]
$ chmod go-r /etc/letsencrypt/archive/[nombre a registrar]/privkey1.pem
[/shell]
Verificación del certificado
Con esto ya tendríamos nuestra web con un certificado firmado por let’s encrypt:




