Let's Encrypt
Let's Encrypt is a service that provides free SSL certificates. It verifies a website's server by a series of challenges before signing any certificate requests.
Getting Certificates
Use the letsencrypt-auto script to interface with Let's Encrypt.
To generate a certificate, turn off any servers on port 80 and then run:
./letsencrypt-auto certonly
Running Without Root
You may try to use the letsencrypt-nosudo project at https://github.com/diafygi/letsencrypt-nosudo.
I was not able to get it working since the API kept on returning a 400 error:
{"type":"urn:acme:error:malformed","detail":"Unable to read/verify body :: JWS verification error","status":400}
This lead me to cheat. (see below)
Getting Certificates for cPanel
Because I do not want to run the letsencrypt-auto script as root on my cPanel account (and this applies to all shared hosting accounts too), I decided to run it inside a VM at home instead and then copy the certificate to the cPanel account. For this to work, I temporarily updated my DNS record to point to my home IP address before running letsencrypt-auto. Once the challenges passes and the certificate is signed, I reverted my DNS to point back to my cPanel server.
While this still exposes the private keys to their script, I was able to get around needing root access on the cPanel server.
Let's encrypt will then place the certificates at /etc/letsencrypt/archive/$DOMAIN$/. To get your certificate working with cPanel, log in to cPanel, click on 'Install an SSL Website', then fill the following fields with their respective file contents:
- Certificate: (CRT) ->
privkey1.pem - Private Key (KEY) ->
cert1.pem - Certificate Authority Bundle: (CABUNDLE) ->
chain1.pem
cPanel should take care of the rest once the SSL certificates are installed.
Renewing
Let's Encrypt's certificates are only valid for 90 days and requires constant renewal. Possible solutions to automate this are:
- Custom DNS zone for let's encrypt so they always see my domains from my home.
- ???