Mise à jour de la doc LetsEncrypt pour Nginx
Cette révision appartient à :
Parent
21a10b6418
révision
e8d97fc12a
|
@ -73,6 +73,9 @@ Alias /.well-known/acme-challenge /var/lib/letsencrypt/.well-known/acme-challeng
|
|||
|
||||
#### Nginx
|
||||
|
||||
Préférez importer le snippet /etc/nginx/snippets/letsencrypt.conf,
|
||||
mais si une configuration manuelle est nécessaire:
|
||||
|
||||
Configuration Jessie :
|
||||
|
||||
~~~
|
||||
|
@ -96,36 +99,24 @@ location ~ /.well-known/acme-challenge {
|
|||
|
||||
## Génération du certificat
|
||||
|
||||
Générér une clé privée (www.example.com.key) et sa demande de certificat associé (www.example.com.csr) (voir [HowtoSSL]()) :
|
||||
Générer une clé privée (www.example.com.key) et sa demande de certificat associé (www.example.com.csr) (voir [HowtoSSL]()) :
|
||||
|
||||
~~~
|
||||
# openssl req -newkey rsa:2048 -sha256 -nodes -keyout /etc/ssl/private/www.example.com.key -out /etc/letsencrypt/www.example.com.csr
|
||||
# chown acme:acme /etc/letsencrypt/www.example.com.csr
|
||||
~~~
|
||||
|
||||
Faire la première demande de certificat avec l'utilisateur _acme_ :
|
||||
|
||||
~~~
|
||||
$ certbot certonly --webroot --csr /etc/letsencrypt/www.example.com/www.example.com.csr --webroot-path /var/lib/letsencrypt \
|
||||
--cert-path /etc/letsencrypt/www.example.com.crt --non-interactive --agree-tos --register-unsafely-without-email
|
||||
~~~
|
||||
|
||||
Votre certificat est maintenant présent dans `/etc/letsencrypt/www.example.com.crt`.
|
||||
|
||||
> *Note* : l'utilisateur _acme_ n'a pas accès aux clés privées :
|
||||
|
||||
~~~
|
||||
$ cat /etc/ssl/private/www.example.com.key
|
||||
cat: /etc/ssl/private/www.example.com.key: Permission non accordée
|
||||
$ certbot certonly -d example.com,www.example.com --cert-name example.com --webroot --webroot-path /var/lib/letsencrypt/
|
||||
~~~
|
||||
|
||||
## Renouvellement du certificat
|
||||
|
||||
Les certificats Let's Encrypt sont valables 90 jours. Avant la date d'expiration, il faudra relancer avec l'utilisateur _acme_ :
|
||||
Les certificats Let's Encrypt sont valables 90 jours. Un timer systemd roule automatiquement à chaque jour pour revalider le certificat. Il est possible d'utiliser --deploy-hook pour faire des actions après un renouvellement. Utiliser systemd edit certbot pour modifier l'invocation par défaut. Par example, pour NGINX, nous modifions
|
||||
|
||||
~~~
|
||||
$ certbot certonly --webroot --csr /etc/letsencrypt/www.example.com/www.example.com.csr --webroot-path /var/lib/letsencrypt \
|
||||
--cert-path /etc/letsencrypt/www.example.com.crt --non-interactive
|
||||
ExecStart=/usr/bin/certbot -q renew
|
||||
~~~
|
||||
|
||||
Avec:
|
||||
|
||||
~~~
|
||||
ExecStart=/usr/bin/certbot -q renew --deploy-hook systemctl reload nginx
|
||||
~~~
|
||||
|
||||
## Suppression d'un certificat
|
||||
|
|
|
@ -578,7 +578,7 @@ Attention, `ssl_certificate` doit contenir toute la chaîne de certification, do
|
|||
# cat sub.class1.server.sha2.ca.pem >> /etc/ssl/certs/ssl.example.com.crt
|
||||
~~~
|
||||
|
||||
Pour une configuration plus avancée, voir [HowtoSSL](HowtoSSL#configuration-nginx)
|
||||
Pour une configuration plus avancée, voir [HowtoSSL](HowtoSSL#configuration-nginx) ou [HowtoLetsEncrypt](HowtoLetsEncrypt#nginx)
|
||||
|
||||
|
||||
## HTTP/2
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket