Parece ser que cada vez se le da más importancia a los certificados SSL en los sitios web. El navegador Google Chrome va a marcar como no seguras todas las páginas que no tengan certificado SSL instalado a partir de julio de este mismo año 2018 [1].
A pesar de que los certificados de pago tienen ciertas ventajas frente a los gratuitos, para los que no vivimos de nuestro sitio web o nos queremos ahorrar unos euros, siempre viene bien el tener una herramienta que nos permita crear certificados gratuitos, y para ello existe Let’s Encrypt SSL.
La herramienta a instalar en nuestro sistema operativo es certbot. Yo particularmente he optado por descargar manualmente certbot, conceder los permisos necesarios y ejecutar la línea correspondiente para generar un certificado:
1 2 |
wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto |
Tras esto, he ejecutado el comando para generar el certificado en un dominio concreto (nótese que hay que modificar las variables que se encuentran entre <>):
1 |
certbot certonly --webroot -w <DIRECTORIO_DEL_VIRTUALHOST> -d www.<TU_DOMINIO> -d <TU_DOMINIO> --email <TU_EMAIL> --agree-tos |
Por ejemplo, para mi dominio jabenitez.com, siendo su directorio /home/jabenite/www sería:
1 |
certbot certonly --webroot -w /home/jabenite/www -d www.jabenitez.com -d jabenitez.com --email info@jabenitez.com --agree-tos |
Pues tras ejecutar esto, obtuve el siguiente error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
IMPORTANT NOTES: - The following errors were reported by the server: Domain: www.jabenitez.com Type: unauthorized Detail: The key authorization file from the server did not match this challenge [q_xgSEl1AYUY2_0EZEiTtHKo8b1y8oezNiPRUm1vV8U.Q7NXPVj9xFc0u8qKxXTR-QW1RC3vyDsT8yP1JwGMbp8] != [q_xgSEl1AYUY2_0EZEiTtHKo8b1y8oezNiPRUm1vV8U.4E3VCTFsySjUrqnCg0ooULx-3kbdPBygi0aWkvg5Gd8] Domain: jabenitez.com Type: unauthorized Detail: The key authorization file from the server did not match this challenge [UCdPksh2HlSkbVy5mXq6pSyuf6EpoPf9BVZOJm54mUo.Q7NXPVj9xFc0u8qKxXTR-QW1RC3vyDsT8yP1JwGMbp8] != [UCdPksh2HlSkbVy5mXq6pSyuf6EpoPf9BVZOJm54mUo.4E3VCTFsySjUrqnCg0ooULx-3kbdPBygi0aWkvg5Gd8] To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address. |
Tras mucho buscar, la solución que yo tuve que aplicar (no tiene porqué ser siempre la misma) fue la de borrar las DNS A de tipo IPv6 en mi servidor, es decir, yo tenía unos registros A/AAA IPv4 asociados a jabenitez.com y www.jabenitez.com y otros registros IPv6. Pues sencillamente borrando los IPv6 asociados al domino jabenitez.com, ya funcionó la generación del certificado.
1 2 3 4 5 6 7 8 9 10 11 12 |
- Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/www.jabenitez.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/www.jabenitez.com/privkey.pem Your cert will expire on 2018-05-15. To obtain a new or tweaked version of this certificate in the future, simply run certbot-auto again. To non-interactively renew *all* of your certificates, run "certbot-auto 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 |
Espero que os haya servido de ayuda el artículo.
[1] Chrome marcará como “no seguras” todas las páginas HTTP a partir de julio