It’s not necessary to use disable CloudFlare to use Let’s Encrypt.
If you’re configuring Let’s Encrypt for the first time for a site already active on CloudFlare, all that is needed to successfully verify and obtain your certificate and private key pair is to use the webroot method for verification.
Download the Let’s Encrypt client and change to the download directory:
git clone https://github.com/letsencrypt/letsencrypt
Run the script for automatic installation:
Using the letsencrypt client with the
certonly command and the
--webroot flag, we’re able to verify and obtain the cert/key pair using HTTP verification. An example command might look like:
/root/.local/share/letsencrypt/bin/letsencrypt certonly --webroot --webroot-path /usr/share/nginx/html/ --renew-by-default --email firstname.lastname@example.org --text --agree-tos -d example.tld -d www.example.tld
--webroot-path is the directory on your server where your site is located (nginx used in the example)
--renew-by-default selects renewal by default when domains are a superset of a previously attained cert
--email is the email used for registration and recovery contact.
--text displays text output
--agree-tos agrees to Let’s Encrypt’s Subscriber Agreement
-d specifies hostnames to add to the SAN.
Successful completion of this verification method will show text similar to the following:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.tld/fullchain.pem. Your cert will expire on
2016-03-03. To obtain a new version of the certificate in the future, simply
run Let's Encrypt again.
As a note, both the cert and key will be saved to /etc/letsencrypt/live/example.tld/ . After both have been obtained, you’ll need to manually update your virtual host to use this key/cert pair.