Command line commands

This package comes with some handy commands that can be run in a terminal session.

To list them you can use this command:

path/to/webroot/concrete/bin/concrete5 list le

Here's the current commands available:

  • le:account-new Create a new Let's Encrypt account
  • le:domain-authorize Create a new Let's Encrypt domain or (re)authorize an existing one
  • le:certificate-new Create a new Let's Encrypt certificate
  • le:renew Renew Let's Encrypt HTTPS certificates that are going to expire

Here's a sample session, where I created a Let's Encrypt account, authorized two domains and created a certificate for them:

$ concrete/bin/concrete5 le:account-new --toc MyAccountName my@email.address 
Generating private key... done.
Account set as default one because it's the only one.
Retrieving the TOS url... done.
Registering account... done.
Saving account... done.

$ concrete/bin/concrete5 le:domain-authorize www.example.com intercept
Retrieving authorization conditions... done.
Persisting domain... done.
Triggering challenge... done.
Current authorization status: Pending authorization...
Sleeping for a while... woke up.
Fetching authorization status... done.
Current authorization status: Authorization succeeded!
Persisting domain... done.
Domain has been authorized.
Expiration date: Nov 14, 2016, 12:57:22 PM
Associated account: MyAccountName


$ concrete/bin/concrete5 le:domain-authorize sid.example.com file --rootdir=/var/www/mysite
Retrieving authorization conditions... done.
Persisting domain... done.
Triggering challenge... done.
Current authorization status: Pending authorization...
Sleeping for a while... woke up.
Fetching authorization status... done.
Current authorization status: Authorization succeeded!
Persisting domain... done.
Domain has been authorized.
Expiration date: Nov 14, 2016, 12:59:33 PM
Associated account: MyAccountName


$ concrete/bin/concrete5 le:domain-authorize mail.example.com dns
Retrieving authorization conditions... done.
Persisting domain... done.

You need to access the DNS server controlling the domain www.example.com.

You have to add this TXT record:
_acme-challenge.mail.example.com.
with this value:
aTy9A9O-m5jQYSTPXcZDV3W2TjQpZV0A_F1qNY-BBFg.KIkaNl4FBcQZTWem4vkf2__uCqrraGPIxZ6bolc-uDw

Here's the full DNS record to add:
_acme-challenge.www.example.com.  300  IN  TXT  "aTy9A9O-m5jQYSTPXcZDV3W2TjQpZV0A_F1qNY-BBFg.KIkaNl4FBcQZTWem4vkf2__uCqrraGPIxZ6bolc-uDw"

Press [ENTER] when you are ready

Triggering challenge... done.
Current authorization status: Pending authorization...
Sleeping for a while... woke up.
Fetching authorization status... done.
Current authorization status: Authorization succeeded!
Persisting domain... done.
Domain has been authorized.
Expiration date: Nov 14, 2016, 12:59:33 PM
Associated account: MyAccountName

$ concrete/bin/concrete5 le:certificate-new \
    --save-privatekey=/etc/ssl/private.key \
    --save-certificate-issuer=/etc/ssl/certificates.crt \
    www.example.com
 sid.example.com mail.example.com

Generating certificate private key... done.
Generating CSR... done.
Requesting new certificate... done.
Persisting certificate... done.
Saving files... done.