Aller au contenu

Générer des certificats SSL avec CertBot

Installation

  • Debian
    # apt install certbot
    
  • FreeBSD

    # pkg install py37-certbot
    

  • OpenBSD

    # pkg_add certbot
    

Générer un certificat let's encrypt

  • Challenge web

    1
    2
    3
    4
    # ECDSA
    $ certbot certonly --key-type ecdsa --cert-name crt-netunix -d netunix.net --elliptic-curve secp384r1 --standalone
    # RSA
    $ certbot certonly --key-type rsa --cert-name crt-netunix -d netunix.net --rsa-key-size 4096 --standalone
    

  • Challenge DNS

    1
    2
    3
    4
    # ECDSA
    certbot certonly --manual --preferred-challenges dns --cert-name crt-netunix -d "*.netunix.net" -d "netunix.net" --elliptic-curve secp384r1 
    # RSA
    certbot certonly --manual --preferred-challenges dns --cert-name crt-netunix -d "*.netunix.net" -d "netunix.net" --key-type rsa --rsa-key-size 4096  
    

Lister les certificats disponibles

$ certbot certificates

Modifier un certificat existant

Exemple pour modifier un certificat de type elliptic curve de secp256r1 en secp384r1 :

$ certbot renew --key-type ecdsa --elliptic-curve secp384r1 --cert-name crt-netunix --force-renewal

Révoquer un certificat

1
2
3
4
# Via le nom
$ certbot revoke --cert-name crt-netunix
# Via le chemin du certificat
$ certbot revoke --cert-path /usr/local/etc/letsencrypt/live/netunix.net/cert.pem

Supprimer un certificat

$ certbot delete --cert-name crt-netunix