let_s_encrypt
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
let_s_encrypt [2018/01/10 01:34] – simon | let_s_encrypt [2019/09/12 19:46] – simon | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
===== Configuration des certificats Let's Encrypt ===== | ===== Configuration des certificats Let's Encrypt ===== | ||
- | J'ai configuré les certificats pour plusieurs noms de domaines et voici la procédure suivie, pour le domaine fictif " | + | === Acme.sh === |
- | + | [[https:// | |
- | J'ai utilisé l' | + | |
+ | La première chose est d' | ||
<code bash> | <code bash> | ||
- | # wget https:// | + | # apt install socat |
- | --2018-01-10 02: | + | # curl https://get.acme.sh | sh |
- | Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.120.133 | + | |
- | Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.120.133|: | + | |
- | HTTP request sent, awaiting response... 200 OK | + | |
- | Length: 9179 (9.0K) [text/ | + | |
- | Saving to: ‘/ | + | |
- | + | ||
- | / | + | |
- | + | ||
- | 2018-01-10 02:30:22 (51.4 MB/s) - ‘/ | + | |
</ | </ | ||
- | On crée un dossier | + | Ensuite, il faut avoir un domaine déjà configuré en HTTP, avec un dossier |
- | <code bash> | + | |
- | # mkdir /etc/letsencrypt | + | |
- | # chown root: | + | |
- | # chmod 750 / | + | |
- | </ | + | |
- | On se déplace dans le dossier qu'on vient de créer : | ||
<code bash> | <code bash> | ||
- | # cd /etc/letsencrypt/ | + | # acme.sh --issue -d plouf.com -d www.plouf.com -w /var/www/plouf/ |
</ | </ | ||
- | Et on lance la génération | + | __**Bonus :**__ L' |
<code bash> | <code bash> | ||
+ | 4 0 * * * "/ | ||
</ | </ | ||
+ | == Choisir une clé ECC et sa taille == | ||
<code bash> | <code bash> | ||
+ | # acme.sh --issue -d plouf.com -d www.plouf.com -w / | ||
</ | </ | ||
+ | == Wildcard == | ||
<code bash> | <code bash> | ||
+ | $ acme.sh --issue -d artanux.be -d ' | ||
</ | </ | ||
- | <code bash> | + | Détails sur la page [[acme.sh]]. |
- | </ | + | |
+ | == Arrêter le renouvellement d'un certificat == | ||
+ | Les explications sont sur [[https:// | ||
<code bash> | <code bash> | ||
+ | # rm -r ~/ | ||
</ | </ | ||
- | <code bash> | + | === Certbot === |
- | </code> | + | <WRAP center round important 60%> |
+ | Cette partie est un peu ancienne et plus forcément pertinente... | ||
+ | </WRAP> | ||
+ | |||
+ | J'ai configuré les certificats pour plusieurs noms de domaines et voici la procédure suivie, pour le domaine fictif " | ||
+ | |||
+ | On commence par activer les backports (sous Stretch) afin de bénéficier de la version de [[certbot]] la plus récente. | ||
<code bash> | <code bash> | ||
+ | # vim / | ||
+ | # | ||
+ | # Backports repository | ||
+ | deb http:// | ||
</ | </ | ||
+ | |||
+ | Dans mon cas, après installation sans les backports, certbot était en version 0.10 alors qu' | ||
<code bash> | <code bash> | ||
+ | # apt-get -t stretch-backports install python-certbot-apache | ||
</ | </ | ||
<code bash> | <code bash> | ||
+ | # certbot --version | ||
+ | certbot 0.19.0 | ||
</ | </ | ||
+ | |||
+ | <WRAP center round alert 60%> | ||
+ | Sur une installation plus récente, j'ai du passer par [[pip]] pour installer certbot 0.21. L' | ||
+ | </ | ||
+ | |||
<code bash> | <code bash> | ||
- | </code> | + | # certbot --apache |
+ | Saving debug log to /var/ | ||
+ | Plugins selected: Authenticator apache, Installer apache | ||
- | <code bash> | + | Which names would you like to activate HTTPS for? |
+ | ------------------------------------------------------------------------------- | ||
+ | 1: plouf.com | ||
+ | 2: chat.plouf.com | ||
+ | 3: wiki.plouf.com | ||
+ | ------------------------------------------------------------------------------- | ||
+ | Select the appropriate numbers separated by commas and/or spaces, or leave input | ||
+ | blank to select all options shown (Enter ' | ||
+ | Obtaining a new certificate | ||
+ | Performing the following challenges: | ||
+ | tls-sni-01 challenge for caliban.be | ||
+ | Enabled Apache socache_shmcb module | ||
+ | Enabled Apache ssl module | ||
+ | Waiting for verification... | ||
+ | Cleaning up challenges | ||
+ | Created an SSL vhost at / | ||
+ | Enabled Apache socache_shmcb module | ||
+ | Enabled Apache ssl module | ||
+ | Deploying Certificate for caliban.be to VirtualHost / | ||
+ | Enabling available site: / | ||
+ | |||
+ | Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. | ||
+ | ------------------------------------------------------------------------------- | ||
+ | 1: No redirect - Make no further changes to the webserver configuration. | ||
+ | 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for | ||
+ | new sites, or if you're confident your site works on HTTPS. You can undo this | ||
+ | change by editing your web server' | ||
+ | ------------------------------------------------------------------------------- | ||
+ | Select the appropriate number [1-2] then [enter] (press ' | ||
+ | Redirecting vhost in / | ||
+ | |||
+ | ------------------------------------------------------------------------------- | ||
+ | Congratulations! You have successfully enabled https:// | ||
+ | |||
+ | You should test your configuration at: | ||
+ | https:// | ||
+ | ------------------------------------------------------------------------------- | ||
+ | |||
+ | IMPORTANT NOTES: | ||
+ | - Congratulations! Your certificate and chain have been saved at: | ||
+ | / | ||
+ | Your key file has been saved at: | ||
+ | / | ||
+ | Your cert will expire on 2018-04-10. To obtain a new or tweaked | ||
+ | | ||
+ | with the " | ||
+ | your certificates, | ||
+ | - If you like Certbot, please consider supporting our work by: | ||
+ | |||
+ | | ||
+ | | ||
</ | </ | ||
+ | On peut tester un renouvellement des certificats avec la commande suivante : | ||
<code bash> | <code bash> | ||
+ | # certbot renew --dry-run | ||
</ | </ | ||
+ | Actuellement, | ||
+ | |||
+ | ==== Clés plus longues ==== | ||
<code bash> | <code bash> | ||
+ | # certbot certonly -a webroot --rsa-key-size 4096 --webroot-path=/ | ||
</ | </ | ||
- | |||
===== Sources ===== | ===== Sources ===== | ||
* [[https:// | * [[https:// |