ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using acme.sh to generate wildcard certificate with Nginx and Cloudflare

    Scheduled Pinned Locked Moved IT Discussion
    4 Posts 2 Posters 2.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alex Sage
      last edited by Alex Sage

      Install acme.sh

      curl https://get.acme.sh | sh
      

      Setup CloudFlare domain API to automatically issue certificate

      First you need to login to your CloudFlare account to get your API key.

      Then run:

      export CF_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
      export CF_Email="[email protected]"
      

      The CF_Key and CF_Email will be saved in ~/.acme.sh/account.conf when you issue your first certificate.

      Issue Wildcard certificates

      acme.sh  --issue -d example.com  -d *.example.com  --dns dns_cf
      

      Not using cloudflare? Check for your DNS provider here: https://github.com/Neilpang/acme.sh/blob/master/dnsapi/README.md

      Install the certificate to NGINX

      acme.sh --install-cert -d example.com \
      --key-file       /path/to/keyfile/in/nginx/key.pem  \
      --fullchain-file /path/to/fullchain/nginx/cert.pem \
      --reloadcmd     "service nginx force-reload"
      

      Now all you need to do is correctly update your NGINX .conf files

      That's it 🙂

      Github: https://github.com/Neilpang/acme.sh

      1 Reply Last reply Reply Quote 1
      • JaredBuschJ
        JaredBusch
        last edited by JaredBusch

        Or, you can chill out and wait a day or three for certbot to add support for it. and not make a snowflake system just to get a wildcard cert that you don't really need, but is admittedly useful at times..

        0_1521049060412_c4ca123b-537b-42a6-bcf2-f99fe60c8da6-image.png

        A 2 Replies Last reply Reply Quote 1
        • A
          Alex Sage @JaredBusch
          last edited by

          @jaredbusch Certbot has ACME v2 support since Version 0.22.0. This version may not yet be available depending on how you install Certbot and your system’s software update mechanism.

          1 Reply Last reply Reply Quote 0
          • A
            Alex Sage @JaredBusch
            last edited by

            @jaredbusch Also, certbot doesn't have automatic DNS configuration.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post