Validate a Let’s encrypt certificates on CloudFlare-enabled websites

In this quick tutorials, I will mention a method to Auto-Renew / Validate a Let’s encrypt certificates on CloudFlare-enabled websites.

As you may know, if you use CloudFlare for DNS/CDN purposes, then you cannot access to several server ports for Let’s Encrypt to validate the certification request. So in this case, we need to use Webroot method as per guided in the Let’s Encrypt website:

So in quick, steps will be as follows:

  • To auto renew, you can create a crontab to run the following command:
    [bash]certbot renew --webroot --webroot-path /YOUR_ROOT_PUBLIC_WEB_PATH/ --renew-by-default --agree-tos --quiet[/bash]

  • Run it, and if it is ok, can setup the above cron. Remember that you will need to restart the web server so that the new certificate files can be taken into place:

    [bash]service nginx restart[/bash]

About NhocConan

A super lazy guy who tries to write tech blog entries in English.He is lazy, so he can only write when he is in a good mood or when he is tired of coding.

Leave a comment

Your email address will not be published. Required fields are marked *